aboutsummaryrefslogtreecommitdiff
path: root/cmd/pwm.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-07-24 09:03:30 -0600
committerTom Rini <trini@konsulko.com>2021-08-02 13:32:14 -0400
commit0b1284eb52578e15ec611adc5fee1a9ae68dadea (patch)
tree2d83815e93fc16decbaa5671fd660ade0ec74532 /cmd/pwm.c
parent7e5f460ec457fe310156e399198a41eb0ce1e98c (diff)
downloadu-boot-0b1284eb52578e15ec611adc5fee1a9ae68dadea.zip
u-boot-0b1284eb52578e15ec611adc5fee1a9ae68dadea.tar.gz
u-boot-0b1284eb52578e15ec611adc5fee1a9ae68dadea.tar.bz2
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 'cmd/pwm.c')
-rw-r--r--cmd/pwm.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/cmd/pwm.c b/cmd/pwm.c
index e1f97c7..87d840a 100644
--- a/cmd/pwm.c
+++ b/cmd/pwm.c
@@ -66,7 +66,7 @@ static int do_pwm(struct cmd_tbl *cmdtp, int flag, int argc,
return CMD_RET_USAGE;
}
- pwm_dev = simple_strtoul(str_pwm, NULL, 10);
+ pwm_dev = dectoul(str_pwm, NULL);
ret = uclass_get_device(UCLASS_PWM, pwm_dev, &dev);
if (ret) {
printf("pwm: '%s' not found\n", str_pwm);
@@ -74,22 +74,22 @@ static int do_pwm(struct cmd_tbl *cmdtp, int flag, int argc,
}
str_channel = *argv;
- channel = simple_strtoul(str_channel, NULL, 10);
+ channel = dectoul(str_channel, NULL);
argc--;
argv++;
if (sub_cmd == PWM_SET_INVERT) {
str_enable = *argv;
- pwm_enable = simple_strtoul(str_enable, NULL, 10);
+ pwm_enable = dectoul(str_enable, NULL);
ret = pwm_set_invert(dev, channel, pwm_enable);
} else if (sub_cmd == PWM_SET_CONFIG) {
str_period = *argv;
argc--;
argv++;
- period_ns = simple_strtoul(str_period, NULL, 10);
+ period_ns = dectoul(str_period, NULL);
str_duty = *argv;
- duty_ns = simple_strtoul(str_duty, NULL, 10);
+ duty_ns = dectoul(str_duty, NULL);
ret = pwm_set_config(dev, channel, period_ns, duty_ns);
} else if (sub_cmd == PWM_SET_ENABLE) {