Skip to content

Commit d2d95a6

Browse files
committed
HSD #15014302485-3: drivers: nand: Use existing API to bind chip to mtd
This patch is to properly bind chip to mtd by use existing API. Previously, it causes the mtd->dev->parent to be wrongly allocated and causes memory corruption responsible for warm reset. Signed-off-by: Dinesh Maniyam <[email protected]>
1 parent d713794 commit d2d95a6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/mtd/nand/raw/cadence_nand.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2056,8 +2056,7 @@ static int cadence_nand_chip_init(struct cadence_nand_info *cadence, ofnode node
20562056

20572057
cadence->selected_chip = cdns_chip->chip;
20582058
chip = &cadence->selected_chip;
2059-
mtd = &chip->mtd;
2060-
mtd->dev->parent = cadence->dev;
2059+
mtd = nand_to_mtd(chip);
20612060
nand_set_flash_node(chip, node);
20622061

20632062
chip->select_chip = cadence_nand_select_chip;

0 commit comments

Comments
 (0)