From eb446ef625bcff969f3e1d3a6874ce9d56113e9b Mon Sep 17 00:00:00 2001 From: Miquel Raynal Date: Fri, 25 Oct 2019 19:39:29 +0200 Subject: cmd: nand/sf: isolate legacy code The 'sf' command is not supposed to rely on the MTD stack, but both 'sf' and 'nand' commands use helpers located in mtd_uboot.c. Despite their location, these functions do not depend at all on the MTD stack. This file (drivers/mtd/mtd_uboot.c) is only compiled if CONFIG_MTD is selected, which is inconsistent with the current situation. Solve this by moving these three functions (which are only used by the above two commands) out of mtd_uboot.c and put them in a C file only compiled with cmd/sf.c and cmd/nand.c. Signed-off-by: Miquel Raynal [trini: Don't export get_part function now] Signed-off-by: Tom Rini --- cmd/Makefile | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cmd/Makefile') diff --git a/cmd/Makefile b/cmd/Makefile index f823d16755e..36b3ceca391 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -97,6 +97,9 @@ obj-$(CONFIG_CMD_MMC) += mmc.o obj-$(CONFIG_MP) += mp.o obj-$(CONFIG_CMD_MTD) += mtd.o obj-$(CONFIG_CMD_MTDPARTS) += mtdparts.o +ifneq ($(CONFIG_CMD_NAND)$(CONFIG_CMD_SF),) +obj-y += legacy-mtd-utils.o +endif obj-$(CONFIG_CMD_NAND) += nand.o obj-$(CONFIG_CMD_NET) += net.o obj-$(CONFIG_CMD_NVEDIT_EFI) += nvedit_efi.o -- cgit v1.2.3