
On Thu, Oct 3, 2019 at 11:21 PM Miquel Raynal miquel.raynal@bootlin.com wrote:
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 miquel.raynal@bootlin.com
cmd/Makefile | 3 ++ cmd/legacy-mtd-utils.c | 99 +++++++++++++++++++++++++++++++++++++++++ cmd/legacy-mtd-utils.h | 14 ++++++ cmd/nand.c | 2 + cmd/sf.c | 2 + drivers/mtd/mtd_uboot.c | 94 --------------------------------------
Better to drop CMD_SF, CMD_NAND in makefile so-that it can't build this file in this patch.