global: Convert simple_strtoul() with hex to hextoul()
It is a pain to have to specify the value 16 in each call. Add a new
hextoul() function and update the code to use it.
Add a proper comment to simple_strtoul() while we are here.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/cmd/tlv_eeprom.c b/cmd/tlv_eeprom.c
index 5099cbd..2b643f9 100644
--- a/cmd/tlv_eeprom.c
+++ b/cmd/tlv_eeprom.c
@@ -751,7 +751,7 @@
/* Convert string to binary */
for (i = 0, p = (char *)string; i < 6; i++) {
- buf[i] = p ? simple_strtoul(p, &end, 16) : 0;
+ buf[i] = p ? hextoul(p, &end) : 0;
if (p)
p = (*end) ? end + 1 : end;
}