[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210520114851.1274609-1-clabbe@baylibre.com>
Date: Thu, 20 May 2021 11:48:50 +0000
From: Corentin Labbe <clabbe@...libre.com>
To: boris.brezillon@...tlin.com, linus.walleij@...aro.org,
miquel.raynal@...tlin.com, richard@....at, vigneshr@...com
Cc: linux-kernel@...r.kernel.org, linux-mtd@...ts.infradead.org,
Corentin Labbe <clabbe@...libre.com>
Subject: [PATCH 1/2] mtd: partitions: redboot: seek fis-index-block in the right node
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@...libre.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
Powered by blists - more mailing lists