From c86a4de8df611b58ec41ae6c42c6fec58e5ab54f Mon Sep 17 00:00:00 2001 From: Patrice Chotard Date: Mon, 21 Mar 2022 09:13:36 +0100 Subject: mtd: Add flash_node in struct mtd_info Currently, add_mtd_partitions_of() can be used only if dev field of mtd_info struct is populated. It's the case, for example, for a spi nor flash, which has a DT compatible "jedec,spi-nor" and an associated device. mtd->dev is populated in spi_nor_scan(). But in case of a raw nand node, mtd_info's dev field can't be populated as flash node has no compatible, so no associated device. add_mtd_partitions_of() can't be used to parse "partitions" subnode. To remove this constraint, add an ofnode field in mtd_info struct which reference the DT flash node. This new field is populated by nand_scan_tail(). This new field will be used by add_mtd_partitions_of() to parse the flash node for "partitions" defined in DT. Signed-off-by: Patrice Chotard Cc: Farhan Ali Cc: Heinrich Schuchardt Cc: Jagan Teki Cc: Marek Behun Cc: Miquel Raynal Cc: Simon Glass Cc: Wolfgang Denk --- include/linux/mtd/mtd.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux') diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 74554009815..af45e63bf9c 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -305,6 +305,7 @@ struct mtd_info { struct device dev; #else struct udevice *dev; + ofnode flash_node; #endif int usecount; -- cgit v1.2.3