mxs_nand: Update compatible string for i.MX6SX
[oweals/u-boot.git] / lib / tiny-printf.c
index 4f7fc239ae9b7795e70ec3678b21469cdf4b6edc..8fc7e48d9942178d07c4e3ef76283ad4011e04d9 100644 (file)
@@ -242,6 +242,7 @@ static int _vprintf(struct printf_info *info, const char *fmt, va_list va)
                                goto abort;
                        case 'u':
                        case 'd':
+                       case 'i':
                                div = 1000000000;
                                if (islong) {
                                        num = va_arg(va, unsigned long);
@@ -251,7 +252,7 @@ static int _vprintf(struct printf_info *info, const char *fmt, va_list va)
                                        num = va_arg(va, unsigned int);
                                }
 
-                               if (ch == 'd') {
+                               if (ch != 'u') {
                                        if (islong && (long)num < 0) {
                                                num = -(long)num;
                                                out(info, '-');
@@ -377,6 +378,22 @@ int sprintf(char *buf, const char *fmt, ...)
        return ret;
 }
 
+#if CONFIG_IS_ENABLED(LOG)
+/* Note that size is ignored */
+int vsnprintf(char *buf, size_t size, const char *fmt, va_list va)
+{
+       struct printf_info info;
+       int ret;
+
+       info.outstr = buf;
+       info.putc = putc_outstr;
+       ret = _vprintf(&info, fmt, va);
+       *info.outstr = '\0';
+
+       return ret;
+}
+#endif
+
 /* Note that size is ignored */
 int snprintf(char *buf, size_t size, const char *fmt, ...)
 {