mtd: rename CONFIG_MTD -> CONFIG_DM_MTD

CONFIG_MTD must be reserved for the MTD core. Like any other
subsystem, prefix the symbol by DM when it comes to DM support.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>
[trini: Add Kconfig files]
Signed-off-by: Tom Rini <trini@konsulko.com>
diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
index 37f379d..fe31273 100644
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
@@ -3,7 +3,7 @@
 config MTD_PARTITIONS
 	bool
 
-config MTD
+config DM_MTD
 	bool "Enable Driver Model for MTD drivers"
 	depends on DM
 	help
@@ -34,7 +34,7 @@
 
 config CFI_FLASH
 	bool "Enable Driver Model for CFI Flash driver"
-	depends on MTD
+	depends on DM_MTD
 	help
 	  The Common Flash Interface specification was developed by Intel,
 	  AMD and other flash manufactures. It provides a universal method
@@ -73,7 +73,7 @@
 
 config ALTERA_QSPI
 	bool "Altera Generic Quad SPI Controller"
-	depends on MTD
+	depends on DM_MTD
 	help
 	  This enables access to Altera EPCQ/EPCS flash chips using the
 	  Altera Generic Quad SPI Controller. The controller converts SPI
@@ -82,14 +82,14 @@
 
 config FLASH_PIC32
 	bool "Microchip PIC32 Flash driver"
-	depends on MACH_PIC32 && MTD
+	depends on MACH_PIC32 && DM_MTD
 	help
 	  This enables access to Microchip PIC32 internal non-CFI flash
 	  chips through PIC32 Non-Volatile-Memory Controller.
 
 config RENESAS_RPC_HF
 	bool "Renesas RCar Gen3 RPC Hyperflash driver"
-	depends on RCAR_GEN3 && MTD
+	depends on RCAR_GEN3 && DM_MTD
 	help
 	  This enables access to Hyperflash memory through the Renesas
 	  RCar Gen3 RPC controller.
diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile
index 293079d..88e5711 100644
--- a/drivers/mtd/Makefile
+++ b/drivers/mtd/Makefile
@@ -6,7 +6,7 @@
 ifneq (,$(findstring y,$(CONFIG_MTD_DEVICE)$(CONFIG_CMD_NAND)$(CONFIG_CMD_ONENAND)$(CONFIG_CMD_SF)$(CONFIG_CMD_MTD)))
 obj-y += mtdcore.o mtd_uboot.o
 endif
-obj-$(CONFIG_MTD) += mtd-uclass.o
+obj-$(CONFIG_DM_MTD) += mtd-uclass.o
 obj-$(CONFIG_MTD_PARTITIONS) += mtdpart.o
 obj-$(CONFIG_MTD_CONCAT) += mtdconcat.o
 obj-$(CONFIG_ALTERA_QSPI) += altera_qspi.o
diff --git a/drivers/mtd/mtd_uboot.c b/drivers/mtd/mtd_uboot.c
index 55742275..7c6c9ac 100644
--- a/drivers/mtd/mtd_uboot.c
+++ b/drivers/mtd/mtd_uboot.c
@@ -99,7 +99,7 @@
 	return -EINVAL;
 }
 
-#if IS_ENABLED(CONFIG_MTD)
+#if IS_ENABLED(CONFIG_DM_MTD)
 static void mtd_probe_uclass_mtd_devs(void)
 {
 	struct udevice *dev;
diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig
index 26cc91a..16165f8 100644
--- a/drivers/mtd/nand/raw/Kconfig
+++ b/drivers/mtd/nand/raw/Kconfig
@@ -67,7 +67,7 @@
 
 config NAND_BRCMNAND
 	bool "Support Broadcom NAND controller"
-	depends on OF_CONTROL && DM && MTD
+	depends on OF_CONTROL && DM && DM_MTD
 	help
 	  Enable the driver for NAND flash on platforms using a Broadcom NAND
 	  controller.
@@ -173,7 +173,7 @@
 
 config NAND_VF610_NFC_DT
         bool "Support Vybrid's vf610 NAND controller as a DT device"
-        depends on OF_CONTROL && MTD
+        depends on OF_CONTROL && DM_MTD
         help
           Enable the driver for Vybrid's vf610 NAND flash on platforms
 	  using device tree.
@@ -266,7 +266,7 @@
 
 config NAND_MXS_DT
 	bool "Support MXS NAND controller as a DT device"
-	depends on OF_CONTROL && MTD
+	depends on OF_CONTROL && DM_MTD
 	help
 	  Enable the driver for MXS NAND flash on platforms using
 	  device tree.
diff --git a/drivers/mtd/nand/spi/Kconfig b/drivers/mtd/nand/spi/Kconfig
index 2197cb5..0777dfd 100644
--- a/drivers/mtd/nand/spi/Kconfig
+++ b/drivers/mtd/nand/spi/Kconfig
@@ -1,6 +1,6 @@
 menuconfig MTD_SPI_NAND
 	bool "SPI NAND device Support"
-	depends on MTD && DM_SPI
+	depends on DM_MTD && DM_SPI
 	select MTD_NAND_CORE
 	select SPI_MEM
 	help