[PATCH 07/21] of/platform: Ensure device registration on lookup

From
Tomeu Vizoso <hidden>
Date
2015-05-25 14:58:30
Also in
linux-devicetree, lkml
Reply to
Tomeu Vizoso, 2015-05-25
When looking up a platform device from its device node, ensure that the
device has been registered before doing the actual search.

This increases the chances of the device having been probed by that
time, reducing deferred probes.

Signed-off-by: Tomeu Vizoso <redacted>
---
 drivers/of/platform.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index cc5d808..af2bc75 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -46,6 +46,8 @@ struct platform_device *of_find_device_by_node(struct device_node *np)
 {
 	struct device *dev;
 
+	of_platform_device_ensure(np);
+
 	dev = bus_find_device(&platform_bus_type, NULL, np, of_dev_node_match);
 	return dev ? to_platform_device(dev) : NULL;
 }
-- 
2.4.1
Thread (70 messages) 70 messages, 15 authors, last reply 2015-06-23
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help