diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2016-11-08 14:36:36 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-11-11 09:54:42 +0100 |
commit | f160f8636e5e5a022b280314bbb8db23a6377d65 (patch) | |
tree | 650ab89188768eca1d011791369e4ea44be92388 /drivers/of/of_path.c | |
parent | 1f2f980373f0232e5a385ebce0945e7950fd99ce (diff) | |
download | barebox-f160f8636e5e5a022b280314bbb8db23a6377d65.tar.gz barebox-f160f8636e5e5a022b280314bbb8db23a6377d65.tar.xz |
of: of_find_path: Add support for new partition binding
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@pengutronix.de>
Diffstat (limited to 'drivers/of/of_path.c')
-rw-r--r-- | drivers/of/of_path.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/of/of_path.c b/drivers/of/of_path.c index 8e1931f939..1f5106df55 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; } |