]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/karo/common/mmc.c
karo: merge with Ka-Ro specific tree for secure boot support
[karo-tx-uboot.git] / board / karo / common / mmc.c
index c6a7a3d5a101296319c72f9bc761d7fcfe47a108..b452a0b1e8123fcd02a303c5a16740cdcad48f62 100644 (file)
@@ -161,12 +161,18 @@ int karo_load_mmc_part(const char *part, void *addr, size_t len)
                debug("Read %u (%u) byte from partition '%s' @ offset 0x"LBAF"\n",
                        ret * mmc->read_bl_len, len, part, part_info.start);
        } else if (partnum == 0) {
-               int len_read;
-
-               printf("Reading file %s from mmc partition %d\n", part, 0);
-               len_read = fs_read(part, (ulong)addr, 0, len);
+               loff_t len_read;
+
+               debug("Reading file %s from mmc partition %d\n", 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);
+                       goto out;
+               }
                if (len_read < len) {
-                       printf("Read only %u of %u bytes\n", len_read, len);
+                       printf("Read only %llu of %u bytes\n", (u64)len_read, len);
                }
        } else {
                ret = partnum;