mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Cc: ukl@pengutronix.de
Subject: [PATCH] mtd: partition: Fix OF partition fixup
Date: Mon, 27 Apr 2015 11:24:10 +0200	[thread overview]
Message-ID: <1430126650-6382-1-git-send-email-s.hauer@pengutronix.de> (raw)

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

             reply	other threads:[~2015-04-27  9:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-27  9:24 Sascha Hauer [this message]
2015-04-27  9:56 ` Uwe Kleine-König
2015-04-30 10:51 ` Marc Kleine-Budde
2015-05-04  7:22   ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1430126650-6382-1-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=ukl@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox