aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/phy
diff options
context:
space:
mode:
authorSimon Glass2021-07-24 09:03:30 -0600
committerTom Rini2021-08-02 13:32:14 -0400
commit0b1284eb52578e15ec611adc5fee1a9ae68dadea (patch)
tree2d83815e93fc16decbaa5671fd660ade0ec74532 /drivers/net/phy
parent7e5f460ec457fe310156e399198a41eb0ce1e98c (diff)
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 'drivers/net/phy')
-rw-r--r--drivers/net/phy/b53.c4
-rw-r--r--drivers/net/phy/mv88e6352.c12
2 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/phy/b53.c b/drivers/net/phy/b53.c
index 695fac47b6c..c706e2b9bde 100644
--- a/drivers/net/phy/b53.c
+++ b/drivers/net/phy/b53.c
@@ -648,7 +648,7 @@ int do_b53_reg_read(const char *name, int argc, char *const argv[])
page = hextoul(argv[1], NULL);
offset = hextoul(argv[2], NULL);
- width = simple_strtoul(argv[3], NULL, 10);
+ width = dectoul(argv[3], NULL);
switch (width) {
case 8:
@@ -700,7 +700,7 @@ int do_b53_reg_write(const char *name, int argc, char *const argv[])
page = hextoul(argv[1], NULL);
offset = hextoul(argv[2], NULL);
- width = simple_strtoul(argv[3], NULL, 10);
+ width = dectoul(argv[3], NULL);
if (width == 48 || width == 64)
value64 = simple_strtoull(argv[4], NULL, 16);
else
diff --git a/drivers/net/phy/mv88e6352.c b/drivers/net/phy/mv88e6352.c
index 07a8e50b480..56060762d85 100644
--- a/drivers/net/phy/mv88e6352.c
+++ b/drivers/net/phy/mv88e6352.c
@@ -238,9 +238,9 @@ int do_mvsw_reg_read(const char *name, int argc, char *const argv[])
u16 value = 0, phyaddr, reg, port;
int ret;
- phyaddr = simple_strtoul(argv[1], NULL, 10);
- port = simple_strtoul(argv[2], NULL, 10);
- reg = simple_strtoul(argv[3], NULL, 10);
+ phyaddr = dectoul(argv[1], NULL);
+ port = dectoul(argv[2], NULL);
+ reg = dectoul(argv[3], NULL);
ret = sw_reg_read(name, phyaddr, port, reg, &value);
printf("%#x\n", value);
@@ -253,9 +253,9 @@ int do_mvsw_reg_write(const char *name, int argc, char *const argv[])
u16 value = 0, phyaddr, reg, port;
int ret;
- phyaddr = simple_strtoul(argv[1], NULL, 10);
- port = simple_strtoul(argv[2], NULL, 10);
- reg = simple_strtoul(argv[3], NULL, 10);
+ phyaddr = dectoul(argv[1], NULL);
+ port = dectoul(argv[2], NULL);
+ reg = dectoul(argv[3], NULL);
value = hextoul(argv[4], NULL);
ret = sw_reg_write(name, phyaddr, port, reg, value);