@@ -869,7 +869,6 @@ config CMD_MMC_SWRITE
config CMD_MTD
bool "mtd"
depends on MTD
- select MTD_PARTITIONS
help
MTD commands support.
@@ -1749,14 +1748,12 @@ config CMD_MTDPARTS
config MTDIDS_DEFAULT
string "Default MTD IDs"
- depends on MTD_PARTITIONS || CMD_MTDPARTS || CMD_NAND || CMD_FLASH
help
Defines a default MTD IDs list for use with MTD partitions in the
Linux MTD command line partitions format.
config MTDPARTS_DEFAULT
string "Default MTD partition scheme"
- depends on MTD_PARTITIONS || CMD_MTDPARTS || CMD_NAND || CMD_FLASH
help
Defines a default MTD partitioning scheme in the Linux MTD command
line partitions format
@@ -1,8 +1,5 @@
menu "MTD Support"
-config MTD_PARTITIONS
- bool
-
config MTD
bool "Enable MTD layer"
help
@@ -3,9 +3,8 @@
# (C) Copyright 2000-2007
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-obj-$(CONFIG_MTD) += mtdcore.o mtd_uboot.o
+obj-$(CONFIG_MTD) += mtdcore.o mtdpart.o mtd_uboot.o
obj-$(CONFIG_DM_MTD) += mtd-uclass.o
-obj-$(CONFIG_MTD_PARTITIONS) += mtdpart.o
obj-$(CONFIG_MTD_CONCAT) += mtdconcat.o
obj-$(CONFIG_ALTERA_QSPI) += altera_qspi.o
obj-$(CONFIG_FLASH_CFI_DRIVER) += cfi_flash.o
@@ -91,7 +91,6 @@ static void mtd_probe_uclass_mtd_devs(void)
static void mtd_probe_uclass_mtd_devs(void) { }
#endif
-#if defined(CONFIG_MTD_PARTITIONS)
extern void board_mtdparts_default(const char **mtdids,
const char **mtdparts);
@@ -283,14 +282,6 @@ int mtd_probe_devices(void)
return 0;
}
-#else
-int mtd_probe_devices(void)
-{
- mtd_probe_uclass_mtd_devs();
-
- return 0;
-}
-#endif /* defined(CONFIG_MTD_PARTITIONS) */
/* Legacy */
@@ -40,9 +40,7 @@
#include <linux/mtd/rawnand.h>
#include <linux/mtd/nand_ecc.h>
#include <linux/mtd/nand_bch.h>
-#ifdef CONFIG_MTD_PARTITIONS
#include <linux/mtd/partitions.h>
-#endif
#include <asm/io.h>
#include <linux/errno.h>
@@ -11,7 +11,6 @@ config MTD_UBI
bool "Enable UBI - Unsorted block images"
select CRC32
select RBTREE
- select MTD_PARTITIONS
help
UBI is a software layer above MTD layer which admits of LVM-like
logical volumes on top of MTD devices, hides some complexities of
@@ -128,12 +128,6 @@
*/
#define CONFIG_BOOTP_BOOTFILESIZE
-#if defined(CONFIG_MTD_PARTITIONS)
-/* MTD partitions */
-
-/* default mtd partition table */
-#endif
-
/* size of console buffer */
#define CONFIG_SYS_CBSIZE 512
/* max number of command args */
@@ -64,7 +64,6 @@
#define CONFIG_SF_DEFAULT_SPEED 1000000
#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
#define CONFIG_ENV_SPI_MODE CONFIG_SF_DEFAULT_MODE
-#define CONFIG_MTD_PARTITIONS /* required for UBI partition support */
/* Environment in SPI NOR flash */
#define CONFIG_ENV_OFFSET 0x180000 /* as Marvell U-Boot version */
@@ -76,7 +76,6 @@
#endif /* CONFIG_ENV_IS_IN_SPI_FLASH */
#ifndef CONFIG_SPL_BUILD
-#define CONFIG_MTD_PARTITIONS
#define MTDIDS_DEFAULT "nor0=ff705000.spi.0"
#endif /* CONFIG_SPL_BUILD */
@@ -534,15 +534,7 @@ extern int unregister_mtd_user (struct mtd_notifier *old);
#endif
void *mtd_kmalloc_up_to(const struct mtd_info *mtd, size_t *size);
-#ifdef CONFIG_MTD_PARTITIONS
void mtd_erase_callback(struct erase_info *instr);
-#else
-static inline void mtd_erase_callback(struct erase_info *instr)
-{
- if (instr->callback)
- instr->callback(instr);
-}
-#endif
static inline int mtd_is_bitflip(int err) {
return err == -EUCLEAN;
@@ -85,26 +85,9 @@ int mtd_add_partition(struct mtd_info *master, const char *name,
long long offset, long long length);
int mtd_del_partition(struct mtd_info *master, int partno);
uint64_t mtd_get_device_size(const struct mtd_info *mtd);
-
-#if defined(CONFIG_MTD_PARTITIONS)
int mtd_parse_partitions(struct mtd_info *parent, const char **_mtdparts,
struct mtd_partition **_parts, int *_nparts);
void mtd_free_parsed_partitions(struct mtd_partition *parts,
unsigned int nparts);
-#else
-static inline int
-mtd_parse_partitions(struct mtd_info *parent, const char **_mtdparts,
- struct mtd_partition **_parts, int *_nparts)
-{
- *_nparts = 0;
-
- return 0;
-}
-static inline void
-mtd_free_parsed_partitions(struct mtd_partition *parts, unsigned int nparts)
-{
- return;
-}
-#endif /* defined(MTD_PARTITIONS) */
#endif
There is no point in compiling mtdparts.c only in certain circumstances. Whether MTD is needed and it will be built, or MTD is not needed and the file will be ignored. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> --- cmd/Kconfig | 3 --- drivers/mtd/Kconfig | 3 --- drivers/mtd/Makefile | 3 +-- drivers/mtd/mtd_uboot.c | 9 --------- drivers/mtd/nand/raw/nand_base.c | 2 -- drivers/mtd/ubi/Kconfig | 1 - include/configs/microblaze-generic.h | 6 ------ include/configs/mvebu_armada-37xx.h | 1 - include/configs/socfpga_stratix10_socdk.h | 1 - include/linux/mtd/mtd.h | 8 -------- include/linux/mtd/partitions.h | 17 ----------------- 11 files changed, 1 insertion(+), 53 deletions(-)