]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mtd: nand: arasan: Set ofnode value
authorAshok Reddy Soma <ashok.reddy.soma@amd.com>
Fri, 24 Feb 2023 05:07:07 +0000 (22:07 -0700)
committerMichal Simek <michal.simek@amd.com>
Thu, 9 Mar 2023 12:15:00 +0000 (13:15 +0100)
Ofnode value is not set, so all the DT properties are not being read
and due to this default values are being used.

Find nand node and set chip->flash_node value.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Link: https://lore.kernel.org/r/20230224050709.30014-3-ashok.reddy.soma@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
drivers/mtd/nand/raw/arasan_nfc.c

index ddb4cb1cbae8609e6aecc44c0455ae3e26501df3..99e2681c14b56c5dc5775a30caf196a5a3d19465 100644 (file)
@@ -1230,12 +1230,16 @@ static int arasan_probe(struct udevice *dev)
        struct nand_drv *info = &arasan->nand_ctrl;
        struct nand_config *nand = &info->config;
        struct mtd_info *mtd;
+       ofnode child;
        int err = -1;
 
        info->reg = (struct nand_regs *)dev_read_addr(dev);
        mtd = nand_to_mtd(nand_chip);
        nand_set_controller_data(nand_chip, &arasan->nand_ctrl);
 
+       ofnode_for_each_subnode(child, dev_ofnode(dev))
+               nand_set_flash_node(nand_chip, child);
+
 #ifdef CONFIG_SYS_NAND_NO_SUBPAGE_WRITE
        nand_chip->options |= NAND_NO_SUBPAGE_WRITE;
 #endif