fs: Kconfig: Clean up representation of mutually exclusive options

The flash and RAM disk options are mutually exclusive (evident e.g. in
both defining FS_VOLUME_SIZE and FS_BLOCK_SIZE variables), so they
should really be inside a choice-endchoice block. The duplicated
options can also taken care of with a single definition using
conditional default values.

Change-Id: I87733f0c342166a9e03aa0e1f34390d91107b137
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2016-10-30 15:38:33 +02:00
commit 51390c39a2

View file

@ -22,44 +22,46 @@ config FILE_SYSTEM
help
Enables support for file system.
if FILE_SYSTEM
config FILE_SYSTEM_FAT
bool "FAT file system support"
default y
depends on FILE_SYSTEM
help
Enables FAT file system support.
choice
prompt "Storage backend selection"
config FS_FAT_RAM_DISK
bool
prompt "RAM Disk"
bool "RAM Disk"
help
RAM buffer used to emulate storage disk.
This option can used to test the file
system.
config FS_FAT_FLASH_DISK
bool
prompt "Flash"
bool "Flash"
help
Flash device is used for the file system.
if FS_FAT_RAM_DISK
endchoice
config FS_VOLUME_SIZE
hex
default 0x18000
default 0x18000 if FS_FAT_RAM_DISK
default 0x200000 if FS_FAT_FLASH_DISK_W25QXXDV
help
This is the file system volume size in bytes.
config FS_BLOCK_SIZE
hex
default 0x1000
default 0x1000 if FS_FAT_RAM_DISK
default 0x1000 if FS_FAT_FLASH_DISK_W25QXXDV
help
This is typically the minimum block size that
is erased at one time in flash storage.
endif # FS_RAM_DISK
if FS_FAT_FLASH_DISK
config FS_FAT_FLASH_DISK_W25QXXDV
@ -71,19 +73,6 @@ config FS_FAT_FLASH_DISK_W25QXXDV
if FS_FAT_FLASH_DISK_W25QXXDV
config FS_VOLUME_SIZE
hex
default 0x200000
help
This is the file system volume size in bytes.
config FS_BLOCK_SIZE
hex
default 0x1000
help
This is typically the minimum flash erase size
that the flash component supports.
config FS_FLASH_DEV_NAME
string
prompt "File system flash storage device name"
@ -113,7 +102,7 @@ config FS_FLASH_ERASE_ALIGNMENT
the flash component.
endif # FS_FAT_FLASH_DISK_W25QXXDV
endif # FS_FAT_FLASH_DISK
endif # FILE_SYSTEM
endmenu