summaryrefslogtreecommitdiff
path: root/board/toradex
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-07-24 18:03:30 +0300
committerTom Rini <trini@konsulko.com>2021-08-02 20:32:14 +0300
commit0b1284eb52578e15ec611adc5fee1a9ae68dadea (patch)
tree2d83815e93fc16decbaa5671fd660ade0ec74532 /board/toradex
parent7e5f460ec457fe310156e399198a41eb0ce1e98c (diff)
downloadu-boot-0b1284eb52578e15ec611adc5fee1a9ae68dadea.tar.xz
global: Convert simple_strtoul() with decimal to dectoul()
It is a pain to have to specify the value 10 in each call. Add a new dectoul() function and update the code to use it. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'board/toradex')
-rw-r--r--board/toradex/common/tdx-cfg-block.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c
index 93eb20cf63..e4f9a0db91 100644
--- a/board/toradex/common/tdx-cfg-block.c
+++ b/board/toradex/common/tdx-cfg-block.c
@@ -548,7 +548,7 @@ static int get_cfgblock_interactive(void)
len = cli_readline(message);
}
- tdx_serial = simple_strtoul(console_buffer, NULL, 10);
+ tdx_serial = dectoul(console_buffer, NULL);
return 0;
}
@@ -566,14 +566,14 @@ static int get_cfgblock_barcode(char *barcode, struct toradex_hw *tag,
/* Get hardware information from the first 8 digits */
tag->ver_major = barcode[4] - '0';
tag->ver_minor = barcode[5] - '0';
- tag->ver_assembly = simple_strtoul(revision, NULL, 10);
+ tag->ver_assembly = dectoul(revision, NULL);
barcode[4] = '\0';
- tag->prodid = simple_strtoul(barcode, NULL, 10);
+ tag->prodid = dectoul(barcode, NULL);
/* Parse second part of the barcode (serial number */
barcode += 8;
- *serial = simple_strtoul(barcode, NULL, 10);
+ *serial = dectoul(barcode, NULL);
return 0;
}
@@ -710,7 +710,7 @@ int try_migrate_tdx_cfg_block_carrier(void)
tdx_car_hw_tag.ver_assembly = pid8[7] - '0';
pid8[4] = '\0';
- tdx_car_hw_tag.prodid = simple_strtoul(pid8, NULL, 10);
+ tdx_car_hw_tag.prodid = dectoul(pid8, NULL);
/* Valid Tag */
write_tag(config_block, &offset, TAG_VALID, NULL, 0);
@@ -754,7 +754,7 @@ static int get_cfgblock_carrier_interactive(void)
sprintf(message, "Choose your carrier board (provide ID): ");
len = cli_readline(message);
- tdx_car_hw_tag.prodid = simple_strtoul(console_buffer, NULL, 10);
+ tdx_car_hw_tag.prodid = dectoul(console_buffer, NULL);
do {
sprintf(message, "Enter carrier board version (e.g. V1.1B): V");
@@ -770,7 +770,7 @@ static int get_cfgblock_carrier_interactive(void)
len = cli_readline(message);
}
- tdx_car_serial = simple_strtoul(console_buffer, NULL, 10);
+ tdx_car_serial = dectoul(console_buffer, NULL);
return 0;
}