[PATCH 3/3] of_path: handle no driver for device

Sascha Hauer s.hauer at pengutronix.de
Thu Oct 20 00:31:22 PDT 2016


in __of_find_path it can happen that there is a device, but there
is no driver for this device because it hasn't been probed yet.
Return -ENODEV in this case to let the caller know that it has to
try later again.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/of/of_path.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/of/of_path.c b/drivers/of/of_path.c
index 8e1931f..12a7c02 100644
--- a/drivers/of/of_path.c
+++ b/drivers/of/of_path.c
@@ -61,6 +61,9 @@ static int __of_find_path(struct device_node *node, const char *part, char **out
 			return -ENODEV;
 	}
 
+	if (!dev->driver)
+		return -ENODEV;
+
 	device_detect(dev);
 
 	if (part)
-- 
2.9.3




More information about the barebox mailing list