[PATCH 2/2] of: of_find_path: Add support for new partition binding

Sascha Hauer s.hauer at pengutronix.de
Tue Nov 8 05:41:49 PST 2016


The partitions now may be in a subnode of the actual device node.
Eventually go another step up in the hierarchy if required.

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

diff --git a/drivers/of/of_path.c b/drivers/of/of_path.c
index 8e1931f..1f5106d 100644
--- a/drivers/of/of_path.c
+++ b/drivers/of/of_path.c
@@ -56,7 +56,12 @@ static int __of_find_path(struct device_node *node, const char *part, char **out
 
 	dev = of_find_device_by_node_path(node->full_name);
 	if (!dev) {
-		dev = of_find_device_by_node_path(node->parent->full_name);
+		struct device_node *devnode = node->parent;
+
+		if (of_device_is_compatible(devnode, "fixed-partitions"))
+			devnode = devnode->parent;
+
+		dev = of_find_device_by_node_path(devnode->full_name);
 		if (!dev)
 			return -ENODEV;
 	}
-- 
2.10.1




More information about the barebox mailing list