mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] mtd: partition: Fix OF partition fixup
@ 2015-04-27  9:24 Sascha Hauer
  2015-04-27  9:56 ` Uwe Kleine-König
  2015-04-30 10:51 ` Marc Kleine-Budde
  0 siblings, 2 replies; 4+ messages in thread
From: Sascha Hauer @ 2015-04-27  9:24 UTC (permalink / raw)
  To: Barebox List; +Cc: ukl

To get the number of address cells and size cells we have to use
the newly created partition node, not the parent device node. The
parent device node returns the address/size cells of the controller
node, not the partition node.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mtd/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/core.c b/drivers/mtd/core.c
index 63b1e4a..431114b 100644
--- a/drivers/mtd/core.c
+++ b/drivers/mtd/core.c
@@ -520,8 +520,8 @@ static int of_mtd_fixup(struct device_node *root, void *ctx)
 		if (!p)
 			return -ENOMEM;
 
-		na = of_n_addr_cells(np);
-		ns = of_n_size_cells(np);
+		na = of_n_addr_cells(part);
+		ns = of_n_size_cells(part);
 
 		of_write_number(tmp + len, partmtd->master_offset, na);
 		len += na * 4;
-- 
2.1.4


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-05-04  7:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-27  9:24 [PATCH] mtd: partition: Fix OF partition fixup Sascha Hauer
2015-04-27  9:56 ` Uwe Kleine-König
2015-04-30 10:51 ` Marc Kleine-Budde
2015-05-04  7:22   ` Sascha Hauer

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