]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mtd: rawnand: gpmi: set chip->of_node to nand@0 child node if present
authorFrank Li <Frank.Li@nxp.com>
Tue, 10 Mar 2026 19:07:37 +0000 (15:07 -0400)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 11 Mar 2026 15:34:22 +0000 (16:34 +0100)
commit3a6e21ea57c8118d3095f073aeaf9362dc2c3865
tree497b08badfbc195f7e5935cebcae560d013e2c71
parent520886a1a6ca16862a0437b4a8fae133a895a9b8
mtd: rawnand: gpmi: set chip->of_node to nand@0 child node if present

The nand-controller.yaml binding requires a child node (e.g. nand@0) under
the NAND controller. However, the driver currently assigns the controller's
of_node directly to the NAND chip.

Search for the first child node with the "nand" prefix and assign it to
chip->of_node. This filters out properties such as "partition" that may be
placed under the controller node in some older DTS files.

Fall back to using the controller's of_node if no suitable child node is
found to maintain backward compatibility.

This issue went unnoticed because the default behavior works for most NAND
chips.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c