]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/cmd_fat.c
* Add automatic update support for LWMON board
[karo-tx-uboot.git] / common / cmd_fat.c
index 150a2ea67c889193de688ff7e71895aeabab57cc..6844c103f22290fa70f6fe46a3397684bbf5e07a 100644 (file)
@@ -86,7 +86,7 @@ int do_fat_fsload (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
        if (argc < 5) {
                printf ("usage: fatload <interface> <dev[:part]> <addr> <filename> [bytes]\n");
-               return (0);
+               return 1;
        }
        dev = (int)simple_strtoul (argv[2], &ep, 16);
        dev_desc=get_dev(argv[1],dev);
@@ -114,14 +114,15 @@ int do_fat_fsload (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
        if(size==-1) {
                printf("\n** Unable to read \"%s\" from %s %d:%d **\n",argv[4],argv[1],dev,part);
-       } else {
-               printf ("\n%ld bytes read\n", size);
-
-               sprintf(buf, "%lX", size);
-               setenv("filesize", buf);
+               return 1;
        }
 
-       return size;
+       printf ("\n%ld bytes read\n", size);
+
+       sprintf(buf, "%lX", size);
+       setenv("filesize", buf);
+
+       return 0;
 }