summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteffen Trumtrar <s.trumtrar@pengutronix.de>2017-06-30 16:53:17 +0200
committerSteffen Trumtrar <s.trumtrar@pengutronix.de>2017-07-03 12:51:46 +0200
commit26148417fab419a0c7f301fb8f2be015324d5374 (patch)
treee12632128910480064878575e7aca7be072841a3 /src
parent5ef3f9b16827478a3bfd24bc07de89a7732d93b9 (diff)
downloaddt-utils-26148417fab419a0c7f301fb8f2be015324d5374.tar.gz
dt-utils-26148417fab419a0c7f301fb8f2be015324d5374.tar.xz
libdt: support finding devices by partuuid
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Diffstat (limited to 'src')
-rw-r--r--src/libdt.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libdt.c b/src/libdt.c
index 3adeed2..2bc6cc1 100644
--- a/src/libdt.c
+++ b/src/libdt.c
@@ -2393,6 +2393,18 @@ int of_get_devicepath(struct device_node *partition_node, char **devpath, off_t
*/
node = partition_node->parent;
+ if (of_device_is_compatible(node, "fixed-partitions")) {
+ const char *uuid;
+
+ /* when partuuid is specified short-circuit the search for the cdev */
+ ret = of_property_read_string(partition_node, "partuuid", &uuid);
+ if (!ret) {
+ *devpath = basprintf("/dev/disk/by-partuuid/%s", uuid);
+
+ return 0;
+ }
+ }
+
/*
* Respect flash "partitions" subnode. Use parent of parent in this
* case.