[U-Boot] [PATCH v3 24/28] cmd: mtdparts: show Kconfig options only if the command is selected

Miquel Raynal miquel.raynal at bootlin.com
Tue Dec 4 23:57:10 UTC 2018


Guard mtdparts options with an if/endif statement in Kconfig. Also
move the Kconfig entry of the option right after the entry of the
command.

Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>
---
 cmd/Kconfig | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/cmd/Kconfig b/cmd/Kconfig
index bf9cc0c52d..cf58174013 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1741,6 +1741,17 @@ config CMD_MTDPARTS
 	  declare the partitions in the mtdparts environment variable
 	  but better use the MTD stack and the 'mtd' command instead.
 
+if CMD_MTDPARTS
+config CMD_MTDPARTS_SPREAD
+	bool "Padd partition size to take account of bad blocks"
+	help
+	  This enables the 'spread' sub-command of the mtdparts command.
+	  This command will modify the existing mtdparts variable by increasing
+	  the size of the partitions such that 1) each partition's net size is
+	  at least as large as the size specified in the mtdparts variable and
+	  2) each partition starts on a good block.
+endif
+
 config MTDIDS_DEFAULT
 	string "Default MTD IDs"
 	depends on MTD_PARTITIONS || CMD_MTDPARTS || CMD_NAND || CMD_FLASH
@@ -1755,16 +1766,6 @@ config MTDPARTS_DEFAULT
 	  Defines a default MTD partitioning scheme in the Linux MTD command
 	  line partitions format
 
-config CMD_MTDPARTS_SPREAD
-	bool "Padd partition size to take account of bad blocks"
-	depends on CMD_MTDPARTS
-	help
-	  This enables the 'spread' sub-command of the mtdparts command.
-	  This command will modify the existing mtdparts variable by increasing
-	  the size of the partitions such that 1) each partition's net size is
-	  at least as large as the size specified in the mtdparts variable and
-	  2) each partition starts on a good block.
-
 config CMD_REISER
 	bool "reiser - Access to reiserfs filesystems"
 	help
-- 
2.19.1



More information about the U-Boot mailing list