Re: [PATCH 6/6] [v5] gpiolib: turn off legacy interface by default
From: sashiko-bot@kernel.org
Date: 2026-06-29 13:46:14
Also in:
linux-leds
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [High] Drivers depending on `GPIOLIB_LEGACY` rather than selecting it are rendered unselectable and silently disabled on normal builds. - [Low] Disabling CONFIG_GPIOLIB_LEGACY by default causes widespread build failures for platforms and drivers still relying on legacy GPIO functions. -- commit bad1a2df68babe59200c7570528e8b8606464b68 Author: Arnd Bergmann [off-list ref] gpiolib: turn off legacy interface by default This commit changes the GPIOLIB_LEGACY configuration to default to 'n' instead of 'y'. It restricts manual selection to builds where COMPILE_TEST is enabled, intending to only build the legacy interface on platforms that require it.
All users of the legacy interface now select CONFIG_GPIOLIB_LEGACY, so it can be turned off by default and only get built on platforms that still have one unconverted driver.
[Severity: High] Is this description entirely accurate? There appear to be drivers that use 'depends on GPIOLIB_LEGACY' rather than selecting it, such as MFD_AAT2870_CORE, MFD_SI476X_CORE, and SND_SOC_TLV320DAC33. If GPIOLIB_LEGACY defaults to 'n' without COMPILE_TEST enabled, will these drivers be rendered unselectable and silently disabled on normal builds?
quoted hunk ↗ jump to hunk
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 020e51e30317a..543de15a12f63 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig@@ -4,7 +4,14 @@ # config GPIOLIB_LEGACY - def_bool y + bool "Legacy GPIO interfaces" if COMPILE_TEST
[Severity: Low]
Could disabling this by default cause build failures on legacy platforms that
still call GPIO functions but do not explicitly select GPIOLIB_LEGACY?
For instance, arch/arm/mach-pxa/am200epd.c still uses gpio_request():
arch/arm/mach-pxa/am200epd.c:am200_init_gpio_regs() {
...
err = gpio_request(gpios[i], gpio_names[i]);
...
}
Because include/linux/gpio.h excludes the legacy prototypes when
CONFIG_GPIOLIB_LEGACY is disabled, will this cause implicit declaration
compiler errors during standard builds for architectures like PXA?
+ help + There are a few legacy platforms that use the traditional GPIO + number based interfaces instead of GPIO descriptors. + Say Y here to enable build testing drivers that are specific + to those platforms. + + If unsure, say N.
-- Sashiko AI review · https://sashiko.dev/#/patchset/20260629130329.1291953-1-arnd@kernel.org?part=6