mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: barebox@lists.infradead.org
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Subject: [PATCH 4/4] commands/miitool: Allow specifying PHY by their full path
Date: Mon,  4 Dec 2017 07:37:26 -0800	[thread overview]
Message-ID: <20171204153726.11479-5-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <20171204153726.11479-1-andrew.smirnov@gmail.com>

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>
---
 commands/miitool.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/commands/miitool.c b/commands/miitool.c
index 1a46037f2..dea4f853c 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
 
-- 
2.14.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2017-12-04 15:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-04 15:37 [PATCH 0/4] A bit more consistent interface for "miitool" Andrey Smirnov
2017-12-04 15:37 ` [PATCH 1/4] commands: miitool: Constify 'phydevname' in mdiobus_show() Andrey Smirnov
2017-12-04 15:37 ` [PATCH 2/4] fs: Introduce devpath_to_name() Andrey Smirnov
2017-12-04 15:37 ` [PATCH 3/4] i.MX: imu-bbu-internal: Make use of devpath_to_name() Andrey Smirnov
2017-12-04 15:37 ` Andrey Smirnov [this message]
2017-12-06 14:55 ` [PATCH 0/4] A bit more consistent interface for "miitool" Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171204153726.11479-5-andrew.smirnov@gmail.com \
    --to=andrew.smirnov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox