Skip to content

Commit

Permalink
mtd: partitions: redboot: seek fis-index-block in the right node
Browse files Browse the repository at this point in the history
[ Upstream commit 2379608 ]

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: c0e118c ("mtd: partitions: Add OF support to RedBoot partitions")
Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210520114851.1274609-1-clabbe@baylibre.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
montjoie authored and gregkh committed Jul 14, 2021
1 parent e6fd14a commit d5023eb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/mtd/parsers/redboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,19 @@ 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;

np = mtd_get_of_node(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;

Expand Down

0 comments on commit d5023eb

Please sign in to comment.