Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd: cfi: enforce valid geometry configuration

MTD allows compile-time configuration of the possible CFI geometry
settings that are allowed by the kernel, but that includes a couple of
invalid configurations, where no bank width or no interleave setting
is allowed. These are then caught with a compile-time warning:

include/linux/mtd/cfi.h:76:2: warning: #warning No CONFIG_MTD_CFI_Ix selected. No NOR chip support can work.
include/linux/mtd/map.h:145:2: warning: #warning "No CONFIG_MTD_MAP_BANK_WIDTH_xx selected. No NOR chip support can work"

This is a bit annoying for randconfig tests, and can be avoided if
we change the Kconfig logic to always select the simplest configuration
when no other one is enabled.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>

authored by

Arnd Bergmann and committed by
Brian Norris
f5f92b36 2c81de77

+4
+4
drivers/mtd/chips/Kconfig
··· 67 67 config MTD_CFI_GEOMETRY 68 68 bool "Specific CFI Flash geometry selection" 69 69 depends on MTD_CFI_ADV_OPTIONS 70 + select MTD_MAP_BANK_WIDTH_1 if !(MTD_MAP_BANK_WIDTH_2 || \ 71 + MTD_MAP_BANK_WIDTH_4 || MTD_MAP_BANK_WIDTH_8 || \ 72 + MTD_MAP_BANK_WIDTH_16 || MTD_MAP_BANK_WIDTH_32) 73 + select MTD_CFI_I1 if !(MTD_CFI_I2 || MTD_CFI_I4 || MTD_CFI_I8) 70 74 help 71 75 This option does not affect the code directly, but will enable 72 76 some other configuration options which would allow you to reduce