cmd: mmc: check whether card is SD or eMMC before hwpartition
authorJaehoon Chung <jh80.chung@samsung.com>
Fri, 24 Sep 2021 00:23:34 +0000 (09:23 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Fri, 29 Oct 2021 09:22:32 +0000 (18:22 +0900)
It doesn't need to follow more sequence to do the hwparititioning,
because SD doesn't support hwpartitioning feature.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
cmd/mmc.c

index 64e6be7..96d81ff 100644 (file)
--- a/cmd/mmc.c
+++ b/cmd/mmc.c
@@ -698,6 +698,11 @@ static int do_mmc_hwpartition(struct cmd_tbl *cmdtp, int flag,
        if (!mmc)
                return CMD_RET_FAILURE;
 
+       if (IS_SD(mmc)) {
+               puts("SD doesn't support partitioning\n");
+               return CMD_RET_FAILURE;
+       }
+
        if (argc < 1)
                return CMD_RET_USAGE;
        i = 1;