diff options
| author | Arnd Bergmann <arnd@arndb.de> | 2026-07-10 23:18:51 +0200 |
|---|---|---|
| committer | Lee Jones <lee@kernel.org> | 2026-07-23 14:08:22 +0100 |
| commit | 98c5c7b0d4269ecabfc86b8b49ffcfa47979e99d (patch) | |
| tree | fe90d73e3ef9d5e0930c382b6b42b995dbeddfc2 /include/linux | |
| parent | b6e08e0ad4cfafab2c2070456e7eeba17608a35d (diff) | |
leds: gpio: Make legacy gpiolib interface optional
There are still a handful of ancient mips/armv5/sh boards that use the
gpio_led:gpio member to pass an old-style gpio number, but all modern
users have been converted to gpio descriptors.
While the CONFIG_GPIOLIB_LEGACY option that guards devm_gpio_request_one()
and related helpers is currently turned on in all kernel builds,
the plan is to only enable it on the few platforms that actually
pass gpio numbers in any platform_data.
Split out the legacy portion of the platform_data handling into a custom
helper function that is guarded with in #ifdef block, to allow the
the leds-gpio driver to compile cleanly when CONFIG_GPIOLIB_LEGACY
gets turned off. Once the last user is converted, this function can
be removed.
Link: https://lore.kernel.org/all/e9252384-a55c-4a91-9c61-06e05a0b2ce4@app.fastmail.com/
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> # for input
Link: https://patch.msgid.link/20260710211854.1371746-4-arnd@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/leds.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/leds.h b/include/linux/leds.h index bf31c246d9e2..a515f075c29a 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h @@ -680,8 +680,10 @@ typedef int (*gpio_blink_set_t)(struct gpio_desc *desc, int state, struct gpio_led { const char *name; const char *default_trigger; +#ifdef CONFIG_GPIOLIB_LEGACY unsigned gpio; unsigned active_low : 1; +#endif unsigned retain_state_suspended : 1; unsigned panic_indicator : 1; unsigned default_state : 2; |
