dfu: mmc: change offset base handling
authorMateusz Zalega <m.zalega@samsung.com>
Mon, 28 Apr 2014 19:13:25 +0000 (21:13 +0200)
committerChanho Park <chanho61.park@samsung.com>
Fri, 24 Jul 2015 07:29:57 +0000 (16:29 +0900)
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>
Conflicts:
include/configs/am335x_evm.h
include/configs/trats.h
include/configs/trats2.h

drivers/dfu/dfu_mmc.c

index 1a73bae0a53dbc7a6a766e1c8e6bf60684caa97c..ac928c380087fe547ec6dec9e5d5777173b74405 100644 (file)
@@ -227,8 +227,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) {