[PATCH] disk: part: change from hextoul to dectoul

Jaehoon Chung jh80.chung at samsung.com
Fri Jun 17 12:01:59 CEST 2022


When 'ls' command is running with partition number, it's passed by a hex
value. For example, if want to check a 15th partition, it has to input
as 0xf.
Before applied
- ls mmc 0:f
After applied
- ls mmc 0:15

The using decimal number is more readable than passed by a hex value.

Signed-off-by: Jaehoon Chung <jh80.chung at samsung.com>
---
 disk/part.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/disk/part.c b/disk/part.c
index 79955c7fb000..31a42d8a2312 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -540,7 +540,7 @@ int blk_get_device_part_str(const char *ifname, const char *dev_part_str,
 		part = PART_AUTO;
 	} else {
 		/* Something specified -> use exactly that */
-		part = (int)hextoul(part_str, &ep);
+		part = (int)dectoul(part_str, &ep);
 		/*
 		 * Less than whole string converted,
 		 * or request for whole device, but caller requires partition.
-- 
2.25.1



More information about the U-Boot mailing list