diff options
author | Lucas Stach <l.stach@pengutronix.de> | 2017-07-31 20:21:01 +0200 |
---|---|---|
committer | Lucas Stach <l.stach@pengutronix.de> | 2017-07-31 20:21:01 +0200 |
commit | d6d7441e90d7859c60cba8b9bc160d7d24692452 (patch) | |
tree | 31337dbe64d7006b5a1a399879c1915819041140 /drivers | |
parent | fcad2a76f7981320ef14592599c7955e985c264d (diff) | |
parent | 69d50079bb0bf5cc6db2c3376fec691208b25c40 (diff) | |
download | barebox-d6d7441e90d7859c60cba8b9bc160d7d24692452.tar.gz barebox-d6d7441e90d7859c60cba8b9bc160d7d24692452.tar.xz |
Merge branch 'for-next/efi'
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/of/of_path.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/of/of_path.c b/drivers/of/of_path.c index 334eab841a..e53041b0a1 100644 --- a/drivers/of/of_path.c +++ b/drivers/of/of_path.c @@ -56,11 +56,26 @@ 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) { + int ret; + const char *uuid; struct device_node *devnode = node->parent; - if (of_device_is_compatible(devnode, "fixed-partitions")) + if (of_device_is_compatible(devnode, "fixed-partitions")) { devnode = devnode->parent; + /* when partuuid is specified short-circuit the search for the cdev */ + ret = of_property_read_string(node, "partuuid", &uuid); + if (!ret) { + cdev = cdev_by_partuuid(uuid); + if (!cdev) + return -ENODEV; + + *outpath = basprintf("/dev/%s", cdev->name); + + return 0; + } + } + dev = of_find_device_by_node_path(devnode->full_name); if (!dev) return -ENODEV; |