summaryrefslogtreecommitdiff
path: root/drivers/gpio
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-08-02 13:32:20 -0400
committerTom Rini <trini@konsulko.com>2021-08-02 13:32:20 -0400
commit51aef405550e603ff702c034f0e2cd0f15bdf2bb (patch)
tree15216d11d6890cd497b6a97176c7aad4c4d63ecf /drivers/gpio
parent73994c452fc5a960114360a651201ac48b135e81 (diff)
parente6951139c0544116330b12e287fe45e30bbab11c (diff)
Merge branch '2021-08-02-numeric-input-cleanups'
- Merge in a series that cleans up and makes more consistent how we deal with numeric input on the CLI. This saves a few bytes in a lot of places.
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-uclass.c2
-rw-r--r--drivers/gpio/mxs_gpio.c4
-rw-r--r--drivers/gpio/pca953x.c4
-rw-r--r--drivers/gpio/tca642x.c4
4 files changed, 7 insertions, 7 deletions
diff --git a/drivers/gpio/gpio-uclass.c b/drivers/gpio/gpio-uclass.c
index 131099cc176..8c77777dbe3 100644
--- a/drivers/gpio/gpio-uclass.c
+++ b/drivers/gpio/gpio-uclass.c
@@ -122,7 +122,7 @@ int dm_gpio_lookup_name(const char *name, struct gpio_desc *desc)
int numeric;
int ret;
- numeric = isdigit(*name) ? simple_strtoul(name, NULL, 10) : -1;
+ numeric = isdigit(*name) ? dectoul(name, NULL) : -1;
for (ret = uclass_first_device(UCLASS_GPIO, &dev);
dev;
ret = uclass_next_device(&dev)) {
diff --git a/drivers/gpio/mxs_gpio.c b/drivers/gpio/mxs_gpio.c
index 5775a22abd4..7b9d88a8a75 100644
--- a/drivers/gpio/mxs_gpio.c
+++ b/drivers/gpio/mxs_gpio.c
@@ -123,12 +123,12 @@ int name_to_gpio(const char *name)
unsigned bank, pin;
char *end;
- bank = simple_strtoul(name, &end, 10);
+ bank = dectoul(name, &end);
if (!*end || *end != ':')
return bank;
- pin = simple_strtoul(end + 1, NULL, 10);
+ pin = dectoul(end + 1, NULL);
return (bank << MXS_PAD_BANK_SHIFT) | (pin << MXS_PAD_PIN_SHIFT);
}
diff --git a/drivers/gpio/pca953x.c b/drivers/gpio/pca953x.c
index 4ab8cee2d18..2fd2996798c 100644
--- a/drivers/gpio/pca953x.c
+++ b/drivers/gpio/pca953x.c
@@ -221,11 +221,11 @@ static int do_pca953x(struct cmd_tbl *cmdtp, int flag, int argc,
/* arg2 used as chip number or pin number */
if (argc > 2)
- ul_arg2 = simple_strtoul(argv[2], NULL, 16);
+ ul_arg2 = hextoul(argv[2], NULL);
/* arg3 used as pin or invert value */
if (argc > 3)
- ul_arg3 = simple_strtoul(argv[3], NULL, 16) & 0x1;
+ ul_arg3 = hextoul(argv[3], NULL) & 0x1;
switch ((long)c->cmd) {
case PCA953X_CMD_INFO:
diff --git a/drivers/gpio/tca642x.c b/drivers/gpio/tca642x.c
index 7007c7a0027..7f67f96b0ec 100644
--- a/drivers/gpio/tca642x.c
+++ b/drivers/gpio/tca642x.c
@@ -262,11 +262,11 @@ static int do_tca642x(struct cmd_tbl *cmdtp, int flag, int argc,
/* arg2 used as chip number or pin number */
if (argc > 2)
- ul_arg2 = simple_strtoul(argv[2], NULL, 10);
+ ul_arg2 = dectoul(argv[2], NULL);
/* arg3 used as pin or invert value */
if (argc > 3)
- ul_arg3 = simple_strtoul(argv[3], NULL, 10) & 0x1;
+ ul_arg3 = dectoul(argv[3], NULL) & 0x1;
switch ((int)c->cmd) {
case TCA642X_CMD_INFO: