Skip to content

Commit 10d54e2

Browse files
ulfalizernashif
authored andcommitted
boards: arm: argonkey: Properly set choice default
The choice symbol LSM6DSL_EXT0_LIS2MDL was given a 'default' in Kboards/arm/96b_argonkey/Kconfig.defconfig, but 'default' has no effect on choice symbols, triggering a warning from Kconfiglib. Instead of adding a default to the choice symbol, change the default of the 'choice' itself by giving it name and adding the default in Kconfig.defconfig. This requires that we remove the default on the "base" definition of the 'choice', due to some messiness related to the Zephyr-specific prefer-later-defaults behavior (see the 'Zephyr-specific Kconfig behavior for defaults' section in the Board Porting Guide). Choices were overlooked when that patch was added to the C tools, meaning choices still prefer earlier defaults. The crux is that Kconfig.defconfig files are included last. Signed-off-by: Ulf Magnusson <[email protected]>
1 parent 9d8c630 commit 10d54e2

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

boards/arm/96b_argonkey/Kconfig.defconfig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ endchoice
5353
config LSM6DSL_SENSORHUB
5454
default y
5555

56-
config LSM6DSL_EXT0_LIS2MDL
57-
default y
56+
choice LSM6DSL_EXTERNAL_SENSOR_0
57+
default LSM6DSL_EXT0_LIS2MDL
58+
endchoice
5859

5960
endif # LSM6DSL
6061

drivers/sensor/lsm6dsl/Kconfig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,16 +198,17 @@ config LSM6DSL_ENABLE_INTERNAL_PULLUP
198198
bool "Enabled internals pull-up resistors"
199199
default y
200200

201-
choice
201+
choice LSM6DSL_EXTERNAL_SENSOR_0
202202
prompt "External sensor 0"
203-
default LSM6DSL_EXT0_LIS2MDL
204203
help
205204
Choose the external sensor 0 connected to LSM6DS3.
206205

207206
config LSM6DSL_EXT0_LIS2MDL
208207
bool "LIS2MDL"
208+
209209
config LSM6DSL_EXT0_LPS22HB
210210
bool "LPS22HB"
211+
211212
endchoice
212213

213214
endif #LSM6DSL_SENSORHUB

0 commit comments

Comments
 (0)