diff mbox series

cmd: mmc: check whether card is SD or eMMC before hwpartition

Message ID 20210924002334.11026-1-jh80.chung@samsung.com
State Accepted
Commit 0d453c84bae95174ca3bd94c72a46112580b24c8
Delegated to: Jaehoon Chung
Headers show
Series cmd: mmc: check whether card is SD or eMMC before hwpartition | expand

Commit Message

Jaehoon Chung Sept. 24, 2021, 12:23 a.m. UTC
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>
---
 cmd/mmc.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Peng Fan (OSS) Sept. 24, 2021, 2:37 a.m. UTC | #1
On 2021/9/24 8:23, Jaehoon Chung wrote:
> 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>
> ---
>   cmd/mmc.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/cmd/mmc.c b/cmd/mmc.c
> index f1e30d0cf64b..62c7e9129666 100644
> --- a/cmd/mmc.c
> +++ b/cmd/mmc.c
> @@ -673,6 +673,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;
> 

Reviewed-by: Peng Fan <peng.fan@nxp.com>
diff mbox series

Patch

diff --git a/cmd/mmc.c b/cmd/mmc.c
index f1e30d0cf64b..62c7e9129666 100644
--- a/cmd/mmc.c
+++ b/cmd/mmc.c
@@ -673,6 +673,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;