diff options
author | Simon Glass <sjg@chromium.org> | 2021-07-24 09:03:30 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-08-02 13:32:14 -0400 |
commit | 0b1284eb52578e15ec611adc5fee1a9ae68dadea (patch) | |
tree | 2d83815e93fc16decbaa5671fd660ade0ec74532 /cmd/pwm.c | |
parent | 7e5f460ec457fe310156e399198a41eb0ce1e98c (diff) | |
download | u-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.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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) { |