mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] of: of_find_node_by_devpath: Fix offset in mtd devices
@ 2017-05-11  8:08 Sascha Hauer
  0 siblings, 0 replies; only message in thread
From: Sascha Hauer @ 2017-05-11  8:08 UTC (permalink / raw)
  To: Barebox List

When a cdev is a mtd device the partition offset must be used from
there, not from the cdev.

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

diff --git a/drivers/of/of_path.c b/drivers/of/of_path.c
index a5886dffac..334eab841a 100644
--- a/drivers/of/of_path.c
+++ b/drivers/of/of_path.c
@@ -142,7 +142,10 @@ struct device_node *of_find_node_by_devpath(struct device_node *root, const char
 	 */
 	if (cdev->master) {
 		is_partition = true;
-		part_offset = cdev->offset;
+		if (cdev->mtd)
+			part_offset = cdev->mtd->master_offset;
+		else
+			part_offset = cdev->offset;
 		part_size = cdev->size;
 		pr_debug("%s path %s: is a partition with offset 0x%08llx, size 0x%08llx\n",
 			 __func__, path, part_offset, part_size);
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-05-11  8:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-11  8:08 [PATCH] of: of_find_node_by_devpath: Fix offset in mtd devices Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox