@@ -4,7 +4,6 @@
# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
mtd-$(CONFIG_MTD) += mtdcore.o mtd_uboot.o
-mtd-$(CONFIG_$(SPL_)DM_MTD) += mtd-uclass.o
mtd-$(CONFIG_MTD_PARTITIONS) += mtdpart.o
mtd-$(CONFIG_MTD_CONCAT) += mtdconcat.o
mtd-$(CONFIG_ALTERA_QSPI) += altera_qspi.o
@@ -18,6 +17,9 @@ mtd-$(CONFIG_STM32_FLASH) += stm32_flash.o
mtd-$(CONFIG_RENESAS_RPC_HF) += renesas_rpc_hf.o
mtd-$(CONFIG_HBMC_AM654) += hbmc-am654.o
+# dm-mtd
+obj-$(CONFIG_$(SPL_)DM_MTD) += mtd-uclass.o
+
# U-Boot build
ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),)
Technically dm and nodm codebases have to build separately since the SPL and U-Boot proper will enable based on the requirements and foot-print sizes. Till now there is no usage of SPL DM_MTD, but if we enable it can't build since the mtd-uclass is linked with nodm MTD code. So move the build link from mtd to obj so-that it can make compatible with all build types. Cc: Simon Glass <sjg at chromium.org> Cc: Vignesh R <vigneshr at ti.com> Signed-off-by: Jagan Teki <jagan at amarulasolutions.com> --- drivers/mtd/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)