Skip to contentSkip to conversation

of: deep-probe: replace BUG() with more verbose panic()

PATCH Applied Ahmad Fatoum 2 participants 2 messages Mar 2, 2022 – Mar 3, 2022 Device tree

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 of: deep-probe: replace BUG() with more verbose panic()

In the case, we do hit this bug, the node name can be helpful, so print it out.

---
 drivers/of/platform.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/of/platform.c +3 -1
index 0e718469dbcd..9b487cbb0c68 100644
@@ -422,7 +422,9 @@ int of_device_ensure_probed(struct device_node *np)
 	if (IS_ERR(dev))
 		return PTR_ERR(dev);
 
-	BUG_ON(!dev);
+	if (!dev)
+		panic("deep-probe: device for '%s' couldn't be created\n",
+			 np->full_name);
 
 	/*
 	 * The deep-probe mechanism relies on the fact that all necessary
Signature · 7 lines
2.34.1


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

In the case, we do hit this bug, the node name can be helpful, so print it out.

---
 drivers/of/platform.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Applied, thanks

Sascha

Quoted 25 lines
drivers/of/platform.c +3 -1
index 0e718469dbcd..9b487cbb0c68 100644
@@ -422,7 +422,9 @@ int of_device_ensure_probed(struct device_node *np)
 	if (IS_ERR(dev))
 		return PTR_ERR(dev);
 
-	BUG_ON(!dev);
+	if (!dev)
+		panic("deep-probe: device for '%s' couldn't be created\n",
+			 np->full_name);
 
 	/*
 	 * The deep-probe mechanism relies on the fact that all necessary
Signature · 7 lines
2.34.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
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