* [PATCH] commands: devinfo: Omit parent if direct descendent of bus
@ 2021-11-29 8:03 Ahmad Fatoum
2021-11-30 10:19 ` Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2021-11-29 8:03 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
In that case parentage adds no extra info, so we can just omit it.
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
v1 -> v2:
- add commands: prefix
- check dev->bus before dereferencing it
---
commands/devinfo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/commands/devinfo.c b/commands/devinfo.c
index 2e2e48e42cc5..32fd55ebd515 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;
--
2.33.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] commands: devinfo: Omit parent if direct descendent of bus
2021-11-29 8:03 [PATCH] commands: devinfo: Omit parent if direct descendent of bus Ahmad Fatoum
@ 2021-11-30 10:19 ` Sascha Hauer
0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2021-11-30 10:19 UTC (permalink / raw)
To: Ahmad Fatoum; +Cc: barebox
On Mon, Nov 29, 2021 at 09:03:56AM +0100, Ahmad Fatoum wrote:
> In that case parentage adds no extra info, so we can just omit it.
>
> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Applied. thanks
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-11-30 10:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-29 8:03 [PATCH] commands: devinfo: Omit parent if direct descendent of bus Ahmad Fatoum
2021-11-30 10:19 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox