summaryrefslogtreecommitdiffstats
path: root/commands/devinfo.c
diff options
context:
space:
mode:
authorAhmad Fatoum <ahmad@a3f.at>2021-11-29 09:03:56 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2021-11-30 11:19:34 +0100
commit1953908c2e79d6042139e5e91c53f9ef00f26381 (patch)
tree8f9054741223a54e8809039ea1946c4199b9177b /commands/devinfo.c
parentb173730e2d0b2fb8843054b01dc5e59d5c1e2e3e (diff)
downloadbarebox-1953908c2e79d6042139e5e91c53f9ef00f26381.tar.gz
barebox-1953908c2e79d6042139e5e91c53f9ef00f26381.tar.xz
commands: devinfo: Omit parent if direct descendent of bus
In that case parentage adds no extra info, so we can just omit it. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20211129080356.2025369-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/devinfo.c')
-rw-r--r--commands/devinfo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/commands/devinfo.c b/commands/devinfo.c
index 2e2e48e42c..32fd55ebd5 100644
--- a/commands/devinfo.c
+++ b/commands/devinfo.c
@@ -85,7 +85,7 @@ static int do_devinfo(int argc, char *argv[])
if (dev->info)
dev->info(dev);
- if (dev->parent)
+ if (dev->parent && (!dev->bus || dev->bus->dev != dev->parent))
printf("Parent: %s\n", dev_name(dev->parent));
first = true;