mtd: rawnand: pl353: Set the nand chip node as the flash node
authorAmit Kumar Mahapatra <amit.kumar-mahapatra@xilinx.com>
Wed, 9 Feb 2022 05:34:27 +0000 (11:04 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:32 +0000 (14:23 +0200)
[ Upstream commit a1fe2ace2c39dcdc7c053705459a73b7598b1e4f ]

In devicetree the flash information is embedded within nand chip node,
so during nand chip initialization the nand chip node should be passed
to nand_set_flash_node() api, instead of nand controller node.

Fixes: 08d8c62164a3 ("mtd: rawnand: pl353: Add support for the ARM PL353 SMC NAND controller")
Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@xilinx.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220209053427.27676-1-amit.kumar-mahapatra@xilinx.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mtd/nand/raw/pl35x-nand-controller.c

index 8a91e069ee2e9be2580c0d0ec804b15998b6b169..3c6f6aff649f8689ca9fbf78938eb04ec6f5c26f 100644 (file)
@@ -1062,7 +1062,7 @@ static int pl35x_nand_chip_init(struct pl35x_nandc *nfc,
        chip->controller = &nfc->controller;
        mtd = nand_to_mtd(chip);
        mtd->dev.parent = nfc->dev;
-       nand_set_flash_node(chip, nfc->dev->of_node);
+       nand_set_flash_node(chip, np);
        if (!mtd->name) {
                mtd->name = devm_kasprintf(nfc->dev, GFP_KERNEL,
                                           "%s", PL35X_NANDC_DRIVER_NAME);