aboutsummaryrefslogtreecommitdiff
path: root/drivers/dfu
diff options
context:
space:
mode:
authorMateusz Zalega2014-04-28 21:13:25 +0200
committerLukasz Majewski2014-05-05 08:20:56 +0200
commitb7d4259af298402b7d65c876d8e39e5b9e6c8934 (patch)
treeb553e9ed36fe49853a1be37f618bff98f57f7569 /drivers/dfu
parent711b931f90e44ff1248cd73c15f64485470d86ff (diff)
dfu: mmc: change offset base handling
Previously offsets handled by dfu_fill_entity_mmc(), defined in boards' CONFIG_DFU_ALT were treated as hexadecimal regardless of their prefix, which sometimes led to confusion. This patch forces usage of explicit numerical base prefixes. Signed-off-by: Mateusz Zalega <m.zalega@samsung.com> Acked-by: Lukasz Majewski <l.majewski@samsung.com> Cc: Tom Rini <trini@ti.com> Cc: Minkyu Kang <mk7.kang@samsung.com>
Diffstat (limited to 'drivers/dfu')
-rw-r--r--drivers/dfu/dfu_mmc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/dfu/dfu_mmc.c b/drivers/dfu/dfu_mmc.c
index b41785dfc71..5e10ea7e664 100644
--- a/drivers/dfu/dfu_mmc.c
+++ b/drivers/dfu/dfu_mmc.c
@@ -215,8 +215,12 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *s)
}
entity_type = argv[0];
- second_arg = simple_strtoul(argv[1], NULL, 16);
- third_arg = simple_strtoul(argv[2], NULL, 16);
+ /*
+ * Base 0 means we'll accept (prefixed with 0x or 0) base 16, 8,
+ * with default 10.
+ */
+ second_arg = simple_strtoul(argv[1], NULL, 0);
+ third_arg = simple_strtoul(argv[2], NULL, 0);
mmc = find_mmc_device(dfu->dev_num);
if (mmc == NULL) {