From patchwork Thu Jul 9 11:17:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 241122 List-Id: U-Boot discussion From: jagan at amarulasolutions.com (Jagan Teki) Date: Thu, 9 Jul 2020 16:47:08 +0530 Subject: [PATCH 4/5] mtd: Build mtd-uclass as obj In-Reply-To: <20200709111709.68904-1-jagan@amarulasolutions.com> References: <20200709111709.68904-1-jagan@amarulasolutions.com> Message-ID: <20200709111709.68904-5-jagan@amarulasolutions.com> 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 Cc: Vignesh R Signed-off-by: Jagan Teki --- drivers/mtd/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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),)