From 10d54e2b22219b4d3d0b413672a0aefda528dcd0 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Mon, 28 May 2018 16:28:53 +0200 Subject: [PATCH] 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 --- boards/arm/96b_argonkey/Kconfig.defconfig | 5 +++-- drivers/sensor/lsm6dsl/Kconfig | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/boards/arm/96b_argonkey/Kconfig.defconfig b/boards/arm/96b_argonkey/Kconfig.defconfig index a7298bf72e8..b802669c715 100644 --- a/boards/arm/96b_argonkey/Kconfig.defconfig +++ b/boards/arm/96b_argonkey/Kconfig.defconfig @@ -53,8 +53,9 @@ endchoice config LSM6DSL_SENSORHUB default y -config LSM6DSL_EXT0_LIS2MDL - default y +choice LSM6DSL_EXTERNAL_SENSOR_0 + default LSM6DSL_EXT0_LIS2MDL +endchoice endif # LSM6DSL diff --git a/drivers/sensor/lsm6dsl/Kconfig b/drivers/sensor/lsm6dsl/Kconfig index 21343b52f3b..e6e61a00cf8 100644 --- a/drivers/sensor/lsm6dsl/Kconfig +++ b/drivers/sensor/lsm6dsl/Kconfig @@ -198,16 +198,17 @@ config LSM6DSL_ENABLE_INTERNAL_PULLUP bool "Enabled internals pull-up resistors" default y -choice +choice LSM6DSL_EXTERNAL_SENSOR_0 prompt "External sensor 0" - default LSM6DSL_EXT0_LIS2MDL help Choose the external sensor 0 connected to LSM6DS3. config LSM6DSL_EXT0_LIS2MDL bool "LIS2MDL" + config LSM6DSL_EXT0_LPS22HB bool "LPS22HB" + endchoice endif #LSM6DSL_SENSORHUB