diff mbox series

[4/5] mtd: Build mtd-uclass as obj

Message ID 20200709111709.68904-5-jagan@amarulasolutions.com
State New
Headers show
Series mtd: Implement MTD UCLASS (use SPINOR) | expand

Commit Message

Jagan Teki July 9, 2020, 11:17 a.m. UTC
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(-)
diff mbox series

Patch

diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile
index f6b0719746..baab7b8657 100644
--- a/drivers/mtd/Makefile
+++ b/drivers/mtd/Makefile
@@ -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),)