[PATCH 18/21] pinctrl: Probe pinctrl devices on demand

From
Tomeu Vizoso <hidden>
Date
2015-05-25 14:58:43
Also in
linux-gpio, lkml
Reply to
Tomeu Vizoso, 2015-05-25
When looking up a pin controller through its DT node, ensure that the
corresponding device has been registered.

Signed-off-by: Tomeu Vizoso <redacted>
---
 drivers/pinctrl/devicetree.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/pinctrl/devicetree.c b/drivers/pinctrl/devicetree.c
index 0bbf7d7..17231ea 100644
--- a/drivers/pinctrl/devicetree.c
+++ b/drivers/pinctrl/devicetree.c
@@ -18,6 +18,7 @@
 
 #include <linux/device.h>
 #include <linux/of.h>
+#include <linux/of_platform.h>
 #include <linux/pinctrl/pinctrl.h>
 #include <linux/slab.h>
 
@@ -118,6 +119,7 @@ static int dt_to_map_one_config(struct pinctrl *p, const char *statename,
 
 	/* Find the pin controller containing np_config */
 	np_pctldev = of_node_get(np_config);
+	of_platform_device_ensure(np_pctldev);
 	for (;;) {
 		np_pctldev = of_get_next_parent(np_pctldev);
 		if (!np_pctldev || of_node_is_root(np_pctldev)) {
-- 
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