Skip to contentSkip to conversation

devinfo: Omit parent if direct descendent of bus

PATCH In review Ahmad Fatoum 2 participants 2 messages Nov 29, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 devinfo: Omit parent if direct descendent of bus

In that case parentage adds no extra info, so we can just omit it.

---
 commands/devinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
commands/devinfo.c +1 -1
index 2e2e48e42cc5..b4894cc9272d 100644
@@ -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->parent != dev->bus->dev)
 			printf("Parent: %s\n", dev_name(dev->parent));
 
 		first = true;
Signature · 7 lines
2.33.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw
Quoted 4 lines · Ahmad Fatoum

In that case parentage adds no extra info, so we can just omit it.

---

Please dismiss. Sent out a (misnamed) v2 just now.

Quoted 17 lines
 commands/devinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
commands/devinfo.c +1 -1
index 2e2e48e42cc5..b4894cc9272d 100644
@@ -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->parent != dev->bus->dev)
 			printf("Parent: %s\n", dev_name(dev->parent));
 
 		first = true;
Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox