]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/karo/common/mmc.c
fs/fs.c: correctly interpret the '(max)len' parameter to fs_read()
[karo-tx-uboot.git] / board / karo / common / mmc.c
index 0048bfb4af02b9bec562ad14e54c5695cee97fe3..6143e1575649dac9f7af379a836ed0ea4c4340e8 100644 (file)
@@ -165,17 +165,15 @@ int karo_load_mmc_part(const char *part, void *addr, size_t len)
        } else if (partnum == 0) {
                loff_t len_read;
 
-               debug("Reading file %s from mmc partition %d\n", part,
-                       partnum);
+               debug("Trying to read (%u) byte from file '%s' in mmc partition %d\n",
+                       len, part, partnum);
                ret = fs_read(part, (ulong)addr, 0, len, &len_read);
                if (ret < 0) {
-                       printf("Failed to read %u byte from mmc partition %d\n",
-                               len, partnum);
+                       printf("Failed to read %u byte from %s in mmc partition %d; err: %d\n",
+                               len, part, partnum, ret);
                        goto out;
                }
-               if (len_read < len) {
-                       printf("Read only %llu of %u bytes\n", (u64)len_read, len);
-               }
+               debug("Read %llu bytes from %s\n", len_read, part);
        } else {
                ret = partnum;
                goto out;