From patchwork Wed Nov 28 23:08:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 1004935 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bootlin.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 434xYl1Qhvz9s3l for ; Thu, 29 Nov 2018 10:24:11 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id E03B7C2237A; Wed, 28 Nov 2018 23:19:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id B7B4FC223D6; Wed, 28 Nov 2018 23:09:16 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 11587C22385; Wed, 28 Nov 2018 23:09:03 +0000 (UTC) Received: from mail.bootlin.com (mail.bootlin.com [62.4.15.54]) by lists.denx.de (Postfix) with ESMTP id 13BEBC22385 for ; Wed, 28 Nov 2018 23:08:26 +0000 (UTC) Received: by mail.bootlin.com (Postfix, from userid 110) id 8EC8820DBF; Thu, 29 Nov 2018 00:08:25 +0100 (CET) Received: from localhost.localdomain (unknown [91.224.148.103]) by mail.bootlin.com (Postfix) with ESMTPSA id D5D7D206FF; Thu, 29 Nov 2018 00:08:24 +0100 (CET) From: Miquel Raynal To: u-boot@lists.denx.de Date: Thu, 29 Nov 2018 00:08:00 +0100 Message-Id: <20181128230800.13292-25-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181128230800.13292-1-miquel.raynal@bootlin.com> References: <20181128230800.13292-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 Cc: Tom Rini , Kyungmin Park , Boris Brezillon , Miquel Raynal , Steve Rae , TsiChung Liew Subject: [U-Boot] [PATCH v2 24/24] mtd: drop CONFIG_MTD_PARTITIONS X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 --- 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(-) diff --git a/cmd/Kconfig b/cmd/Kconfig index 717e814c56..08a2c27ac2 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -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 diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig index 0832f5b411..c4b17f87fe 100644 --- a/drivers/mtd/Kconfig +++ b/drivers/mtd/Kconfig @@ -1,8 +1,5 @@ menu "MTD Support" -config MTD_PARTITIONS - bool - config MTD bool "Enable MTD layer" help diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile index fc4c7e0d1f..7574084f36 100644 --- a/drivers/mtd/Makefile +++ b/drivers/mtd/Makefile @@ -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 diff --git a/drivers/mtd/mtd_uboot.c b/drivers/mtd/mtd_uboot.c index cce162461b..9c8325546d 100644 --- a/drivers/mtd/mtd_uboot.c +++ b/drivers/mtd/mtd_uboot.c @@ -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 */ diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c index 92daebe120..0d56dc7b3b 100644 --- a/drivers/mtd/nand/raw/nand_base.c +++ b/drivers/mtd/nand/raw/nand_base.c @@ -40,9 +40,7 @@ #include #include #include -#ifdef CONFIG_MTD_PARTITIONS #include -#endif #include #include diff --git a/drivers/mtd/ubi/Kconfig b/drivers/mtd/ubi/Kconfig index cf84783356..db1409c9d4 100644 --- a/drivers/mtd/ubi/Kconfig +++ b/drivers/mtd/ubi/Kconfig @@ -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 diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index ba0952c73c..18c9bf15f9 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -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 */ diff --git a/include/configs/mvebu_armada-37xx.h b/include/configs/mvebu_armada-37xx.h index 640267c9c2..04083f4404 100644 --- a/include/configs/mvebu_armada-37xx.h +++ b/include/configs/mvebu_armada-37xx.h @@ -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 */ diff --git a/include/configs/socfpga_stratix10_socdk.h b/include/configs/socfpga_stratix10_socdk.h index 967784e379..bc1fe0ede6 100644 --- a/include/configs/socfpga_stratix10_socdk.h +++ b/include/configs/socfpga_stratix10_socdk.h @@ -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 */ diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 68e5915324..993dc102c0 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -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; diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h index 3822237f2a..e44cf77666 100644 --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h @@ -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