diff mbox series

[v3,3/4] mtd: rawnand: denali_dt: use UCLASS_MTD instead of UCLASS_MISC

Message ID 20200130130759.2286-1-yamada.masahiro@socionext.com
State Accepted
Commit 407b01b3b3f548d951b3c35a40bb49bb82f31748
Headers show
Series None | expand

Commit Message

Masahiro Yamada Jan. 30, 2020, 1:07 p.m. UTC
UCLASS_MTD is a better fit for NAND drivers.

Make NAND_DENALI_DT depend on DM_MTD, which is needed to compile
drivers/mtd/mtd-uclass.c

Also, make ARCH_UNIPHIER select DM_MTD because all the defconfig
of this platform enables NAND_DENALI_DT.

Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>
Reviewed-by: Miquel Raynal <miquel.raynal at bootlin.com>
---

Changes in v3:
 - drop the change fro ARCH_SOCFPGA

Changes in v2:
 - new patch


 arch/arm/Kconfig                 | 1 +
 drivers/mtd/nand/raw/Kconfig     | 2 +-
 drivers/mtd/nand/raw/denali_dt.c | 4 ++--
 3 files changed, 4 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 123631516883..f04b6a6d368e 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1548,6 +1548,7 @@  config ARCH_UNIPHIER
 	select DM_GPIO
 	select DM_I2C
 	select DM_MMC
+	select DM_MTD
 	select DM_RESET
 	select DM_SERIAL
 	select DM_USB
diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig
index 7814d84ba01d..23201ca72041 100644
--- a/drivers/mtd/nand/raw/Kconfig
+++ b/drivers/mtd/nand/raw/Kconfig
@@ -116,7 +116,7 @@  config NAND_DENALI
 config NAND_DENALI_DT
 	bool "Support Denali NAND controller as a DT device"
 	select NAND_DENALI
-	depends on OF_CONTROL && DM
+	depends on OF_CONTROL && DM_MTD
 	help
 	  Enable the driver for NAND flash on platforms using a Denali NAND
 	  controller as a DT device.
diff --git a/drivers/mtd/nand/raw/denali_dt.c b/drivers/mtd/nand/raw/denali_dt.c
index f133dd3840f9..05b9c333e045 100644
--- a/drivers/mtd/nand/raw/denali_dt.c
+++ b/drivers/mtd/nand/raw/denali_dt.c
@@ -160,7 +160,7 @@  static int denali_dt_probe(struct udevice *dev)
 
 U_BOOT_DRIVER(denali_nand_dt) = {
 	.name = "denali-nand-dt",
-	.id = UCLASS_MISC,
+	.id = UCLASS_MTD,
 	.of_match = denali_nand_dt_ids,
 	.probe = denali_dt_probe,
 	.priv_auto_alloc_size = sizeof(struct denali_nand_info),
@@ -171,7 +171,7 @@  void board_nand_init(void)
 	struct udevice *dev;
 	int ret;
 
-	ret = uclass_get_device_by_driver(UCLASS_MISC,
+	ret = uclass_get_device_by_driver(UCLASS_MTD,
 					  DM_GET_DRIVER(denali_nand_dt),
 					  &dev);
 	if (ret && ret != -ENODEV)