public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mtd: partitions: redboot: seek fis-index-block in the right node
@ 2021-05-20 11:48 Corentin Labbe
  2021-05-20 11:48 ` [PATCH 2/2] mtd: partitions: redboot: fix style issues Corentin Labbe
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Corentin Labbe @ 2021-05-20 11:48 UTC (permalink / raw)
  To: boris.brezillon, linus.walleij, miquel.raynal, richard, vigneshr
  Cc: linux-kernel, linux-mtd, Corentin Labbe

fis-index-block is seeked in the master node and not in the partitions node.
For following binding and current usage, the driver need to check the
partitions subnode.

Fixes: c0e118c8a1a3 ("mtd: partitions: Add OF support to RedBoot partitions")
Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
---
 drivers/mtd/parsers/redboot.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/parsers/redboot.c b/drivers/mtd/parsers/redboot.c
index 91146bdc4713..3ccd6363ee8c 100644
--- a/drivers/mtd/parsers/redboot.c
+++ b/drivers/mtd/parsers/redboot.c
@@ -45,6 +45,7 @@ static inline int redboot_checksum(struct fis_image_desc *img)
 static void parse_redboot_of(struct mtd_info *master)
 {
 	struct device_node *np;
+	struct device_node *npart;
 	u32 dirblock;
 	int ret;
 
@@ -52,7 +53,11 @@ static void parse_redboot_of(struct mtd_info *master)
 	if (!np)
 		return;
 
-	ret = of_property_read_u32(np, "fis-index-block", &dirblock);
+	npart = of_get_child_by_name(np, "partitions");
+	if (!npart)
+		return;
+
+	ret = of_property_read_u32(npart, "fis-index-block", &dirblock);
 	if (ret)
 		return;
 
-- 
2.26.3


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

end of thread, other threads:[~2021-05-26  9:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-20 11:48 [PATCH 1/2] mtd: partitions: redboot: seek fis-index-block in the right node Corentin Labbe
2021-05-20 11:48 ` [PATCH 2/2] mtd: partitions: redboot: fix style issues Corentin Labbe
2021-05-20 15:24   ` Linus Walleij
2021-05-20 15:36     ` Miquel Raynal
2021-05-20 16:00       ` Linus Walleij
2021-05-20 16:07         ` Miquel Raynal
2021-05-26  9:02   ` Miquel Raynal
2021-05-20 15:21 ` [PATCH 1/2] mtd: partitions: redboot: seek fis-index-block in the right node Linus Walleij
2021-05-26  9:02 ` Miquel Raynal

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