X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=common%2Fcmd_fat.c;h=aae993d2b9a486c7ca1bdc16c10f7c84e9c817b9;hb=fdd6994fe0b1ed4e75ed47f6a7d056dea753ef2a;hp=633fbf1d311391bb9aa69fd9ce905013b12e9805;hpb=5a1095a830299aef8dd32495e505e92ab1749e89;p=karo-tx-uboot.git diff --git a/common/cmd_fat.c b/common/cmd_fat.c index 633fbf1d31..aae993d2b9 100644 --- a/common/cmd_fat.c +++ b/common/cmd_fat.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -100,7 +101,8 @@ U_BOOT_CMD( static int do_fat_fswrite(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { - long size; + loff_t size; + int ret; unsigned long addr; unsigned long count; block_dev_desc_t *dev_desc = NULL; @@ -127,15 +129,15 @@ static int do_fat_fswrite(cmd_tbl_t *cmdtp, int flag, count = simple_strtoul(argv[5], NULL, 16); buf = map_sysmem(addr, count); - size = file_fat_write(argv[4], buf, count); + ret = file_fat_write(argv[4], buf, 0, count, &size); unmap_sysmem(buf); - if (size == -1) { + if (ret < 0) { printf("\n** Unable to write \"%s\" from %s %d:%d **\n", argv[4], argv[1], dev, part); return 1; } - printf("%ld bytes written\n", size); + printf("%llu bytes written\n", size); return 0; }