From 0d453c84bae95174ca3bd94c72a46112580b24c8 Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Fri, 24 Sep 2021 09:23:34 +0900 Subject: [PATCH] cmd: mmc: check whether card is SD or eMMC before hwpartition It doesn't need to follow more sequence to do the hwparititioning, because SD doesn't support hwpartitioning feature. Signed-off-by: Jaehoon Chung Reviewed-by: Peng Fan Signed-off-by: Jaehoon Chung --- cmd/mmc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/mmc.c b/cmd/mmc.c index 64e6be7..96d81ff 100644 --- 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; -- 2.7.4