From: Arnd Bergmann arnd@arndb.de
[ Upstream commit e399d779c9acf277488c5b306b71dcbc71e160ca ]
This driver uses the legacy gpiolib interfaces to get gpio numbers from platform data:
drivers/mfd/si476x-i2c.c: In function 'si476x_core_start': drivers/mfd/si476x-i2c.c:133:21: error: implicit declaration of function 'gpio_is_valid'; did you mean 'uuid_is_valid'? [-Werror=implicit-function-declaration] 133 | if (gpio_is_valid(core->gpio_reset))
There are no in-tree users of this driver, so nothing defines the platform data.
Add a dependency on GPIOLIB_LEGACY for the moment to avoid the build failure, and make sure the sound driver does not get built without the mfd portion either pass that dependency along.
Alternatively, we could remove the mfd driver along with the radio and sound portions.
Reported-by: kernel test robot lkp@intel.com Closes: https://lore.kernel.org/oe-kbuild-all/202507231653.UFlH2dMO-lkp@intel.com/ Signed-off-by: Arnd Bergmann arnd@arndb.de Link: https://lore.kernel.org/r/20250808151822.536879-14-arnd@kernel.org Signed-off-by: Lee Jones lee@kernel.org Signed-off-by: Sasha Levin sashal@kernel.org ---
LLM Generated explanations, may be completely bogus:
YES
- What it fixes - Prevents a reproducible build failure when the legacy GPIO number- based API is disabled. The si476x MFD core calls legacy helpers such as `gpio_is_valid()` and `gpio_set_value_cansleep()` in `drivers/mfd/si476x-i2c.c:133` and `drivers/mfd/si476x-i2c.c:200`, which come from `linux/gpio.h` and are only provided when `CONFIG_GPIOLIB_LEGACY` is enabled. With legacy interfaces fenced off, the build hits an implicit declaration error as reported by kbuild test robot.
- Why it’s needed in stable - The GPIO subsystem recently made legacy interfaces optional/fenced off, which exposed drivers still using global GPIO numbers. This patch is part of that follow-up hardening: it gates the si476x core on `GPIOLIB_LEGACY`, avoiding invalid build combinations. It is a pure Kconfig fix with no runtime behavior change, directly addressing a regression introduced by the gpiolib changes and thus a textbook stable backport candidate for trees that have those gpiolib changes.
- Scope and risk - Small, contained Kconfig-only change; no functional code altered. - No architectural changes; only dependency tightening to avoid broken builds. - No known security implications. - Very low regression risk: there are no in-tree users of this driver, and the change merely prevents selecting an invalid configuration.
- Code references - Legacy GPIO API use causing the build error: - `drivers/mfd/si476x-i2c.c:133` - `drivers/mfd/si476x-i2c.c:200` - Legacy GPIO API is only provided under `CONFIG_GPIOLIB_LEGACY`: - `include/linux/gpio.h:1` - Kconfig dependency added to ensure the MFD core only builds when legacy GPIO is available: - `drivers/mfd/Kconfig:1443` adds `depends on GPIOLIB_LEGACY` to `MFD_SI476X_CORE` - Kconfig tightening to avoid building the codec without the MFD core (and by extension, without legacy GPIO): - `sound/soc/codecs/Kconfig:1945` adds `depends on MFD_SI476X_CORE` to `SND_SOC_SI476X`
- Stable backport guidance - Apply to stable series that include the GPIO changes making legacy interfaces optional/fenced (e.g., the 6.17 cycle and derivatives). It is not needed for older stable trees where legacy GPIO interfaces were always available (or where `GPIOLIB_LEGACY` is not present/always-on).
drivers/mfd/Kconfig | 1 + sound/soc/codecs/Kconfig | 1 + 2 files changed, 2 insertions(+)
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 425c5fba6cb1e..6d52a3d22430f 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -1411,6 +1411,7 @@ config MFD_SEC_I2C config MFD_SI476X_CORE tristate "Silicon Laboratories 4761/64/68 AM/FM radio." depends on I2C + depends on GPIOLIB_LEGACY select MFD_CORE select REGMAP_I2C help diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index 6d7e4725d89cd..dfe907c62604c 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -1902,6 +1902,7 @@ config SND_SOC_SGTL5000
config SND_SOC_SI476X tristate + depends on MFD_SI476X_CORE
config SND_SOC_SIGMADSP tristate