]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/cmd_mmc.c
Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'
[karo-tx-uboot.git] / common / cmd_mmc.c
index 8c53a10315ecec188d75d87c15b67a1971e59aa7..9f3d6c575bfe2ef8c12b54d4fb1f0e42e2eacfa0 100644 (file)
@@ -164,8 +164,12 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        }
 
        if (strcmp(argv[1], "rescan") == 0) {
-               struct mmc *mmc = find_mmc_device(curr_device);
+               struct mmc *mmc;
 
+               if (argc != 2)
+                       return CMD_RET_USAGE;
+
+               mmc = find_mmc_device(curr_device);
                if (!mmc) {
                        printf("no mmc device at slot %x\n", curr_device);
                        return 1;
@@ -179,8 +183,12 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                        return 0;
        } else if (strncmp(argv[1], "part", 4) == 0) {
                block_dev_desc_t *mmc_dev;
-               struct mmc *mmc = find_mmc_device(curr_device);
+               struct mmc *mmc;
+
+               if (argc != 2)
+                       return CMD_RET_USAGE;
 
+               mmc = find_mmc_device(curr_device);
                if (!mmc) {
                        printf("no mmc device at slot %x\n", curr_device);
                        return 1;
@@ -196,6 +204,8 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                puts("get mmc type error!\n");
                return 1;
        } else if (strcmp(argv[1], "list") == 0) {
+               if (argc != 2)
+                       return CMD_RET_USAGE;
                print_mmc_devices('\n');
                return 0;
        } else if (strcmp(argv[1], "dev") == 0) {