diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2020-06-19 16:03:53 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-06-23 09:57:40 +0200 |
commit | 61b28fb70a9f1be33705279456d2705d94556a83 (patch) | |
tree | c0a7b8710b692cba7de14d5d7adebfeb565edfbd /commands | |
parent | c4f3b2862790d370f5e0db26fd506d3ab47d2e9a (diff) | |
download | barebox-61b28fb70a9f1be33705279456d2705d94556a83.tar.gz barebox-61b28fb70a9f1be33705279456d2705d94556a83.tar.xz |
devinfo: print device parent along with device info
Especially for "virtual" devices (e.g. wdog0 or mmc2), it is often
useful to know the corresponding hardware device.
Instead of always having to search through plain devinfo, just
include this information in the output when running
`devinfo device`.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r-- | commands/devinfo.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/commands/devinfo.c b/commands/devinfo.c index 81956b1cc0..2e2e48e42c 100644 --- a/commands/devinfo.c +++ b/commands/devinfo.c @@ -85,6 +85,9 @@ static int do_devinfo(int argc, char *argv[]) if (dev->info) dev->info(dev); + if (dev->parent) + printf("Parent: %s\n", dev_name(dev->parent)); + first = true; list_for_each_entry(param, &dev->parameters, list) { if (first) { |