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, 0);
- if (len_read < 0)
- printf("Read from %s failed: %d\n", part, len_read);
+ loff_t len_read;
+
+ 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 %s in mmc partition %d; err: %d\n",
+ len, part, partnum, ret);
+ goto out;
+ }
+ debug("Read %llu bytes from %s\n", len_read, part);
} else {
ret = partnum;
goto out;