[PATCH 3/3] cmd: mmc: Return symbolic value when part switching fails in mmc dev

Yao Zi me at ziyao.cc
Fri Jan 30 19:03:53 CET 2026


Return symbolic value CMD_RET_FAILURE instead of literal "1" when
failing to switch the partition to improve readability.

Signed-off-by: Yao Zi <me at ziyao.cc>
---
 cmd/mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/mmc.c b/cmd/mmc.c
index 512bd482ae82..bcbe963f8ac0 100644
--- a/cmd/mmc.c
+++ b/cmd/mmc.c
@@ -606,7 +606,7 @@ static int do_mmc_dev(struct cmd_tbl *cmdtp, int flag,
 	printf("switch to partitions #%d, %s\n",
 	       part, (!ret) ? "OK" : "ERROR");
 	if (ret)
-		return 1;
+		return CMD_RET_FAILURE;
 
 	curr_device = dev;
 	if (mmc->part_config == MMCPART_NOAVAILABLE)
-- 
2.52.0



More information about the U-Boot mailing list