summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorAndrey Smirnov <andrew.smirnov@gmail.com>2017-12-04 07:37:26 -0800
committerSascha Hauer <s.hauer@pengutronix.de>2017-12-06 15:54:32 +0100
commit9e34d2ee095eef72abda98af486b2c26020a9622 (patch)
tree75cb1c2f629d43cfdc0529746869348cf294fcf1 /commands
parente94b91e6da573fadf1463c31610d56d4099601db (diff)
downloadbarebox-9e34d2ee095eef72abda98af486b2c26020a9622.tar.gz
commands/miitool: Allow specifying PHY by their full path
Make -s option to be a bit more consistent with how it is used in other commands by allowing PHY device to be specified by either its name of full path in /dev. This change also allows us to leverage autocompletion since it will work as expected for paths in /dev. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r--commands/miitool.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/commands/miitool.c b/commands/miitool.c
index 1a46037..dea4f85 100644
--- a/commands/miitool.c
+++ b/commands/miitool.c
@@ -338,7 +338,9 @@ static int do_miitool(int argc, char *argv[])
case MIITOOL_SHOW:
for_each_mii_bus(mii) {
mdiobus_detect(&mii->dev);
- mdiobus_show(&mii->dev, phydevname, verbose);
+ mdiobus_show(&mii->dev,
+ devpath_to_name(phydevname),
+ verbose);
}
break;
}
@@ -358,7 +360,7 @@ BAREBOX_CMD_HELP_TEXT("adapters use an MII to autonegotiate link speed and duple
BAREBOX_CMD_HELP_TEXT("")
BAREBOX_CMD_HELP_TEXT("Options:")
BAREBOX_CMD_HELP_OPT("-v", "increase verbosity")
-BAREBOX_CMD_HELP_OPT("-s <devname>", "show PHY status (not providing PHY prints status of all)")
+BAREBOX_CMD_HELP_OPT("-s <devpath/devname>", "show PHY status (not providing PHY prints status of all)")
BAREBOX_CMD_HELP_OPT("-r <busno>:<adr>", "register a PHY")
BAREBOX_CMD_HELP_END