summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libdt.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libdt.c b/src/libdt.c
index 2c730cd..4db5160 100644
--- a/src/libdt.c
+++ b/src/libdt.c
@@ -2391,9 +2391,15 @@ int of_get_devicepath(struct device_node *partition_node, char **devpath, off_t
/*
* Ok, the partition node has no udev_device. Try parent node.
*/
-
node = partition_node->parent;
+ /*
+ * Respect flash "partitions" subnode. Use parent of parent in this
+ * case.
+ */
+ if (!strcmp(node->name, "partitions"))
+ node = node->parent;
+
dev = of_find_device_by_node_path(node->full_name);
if (!dev) {
fprintf(stderr, "%s: cannot find device from node %s\n", __func__,