leds: fix ifdef check for gpio_led_register_device()
PATCH 1/1 leds: fix ifdef check for gpio_led_register_device()
From: Arnd Bergmann <[email protected]>
gpio_led_register_device() is built whenever CONFIG_LEDS_GPIO_REGISTER is enabled, and this may be used even when CONFIG_NEW_LEDS is turned off.
However, the stub declaration in the header is provided for all configs without CONFIG_NEW_LEDS, resulting in a build failure:
drivers/leds/leds-gpio-register.c:24:1: error: redefinition of 'gpio_led_register_device'
24 | gpio_led_register_device(int id, const struct gpio_led_platform_data *pdata)
| ^
include/linux/leds.h:646:39: note: previous definition is here
Change the #ifdef check to match the definition.
Note: this apparently took years of randconfig builds to hit, since a number of other drivers just 'select NEW_LEDS' anyway.
--- include/linux/leds.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/leds.h +1 -1
@@ -639,7 +639,7 @@ struct gpio_led_platform_data {gpio_blink_set_t gpio_blink_set; }; -#ifdef CONFIG_NEW_LEDS +#ifdef CONFIG_LEDS_GPIO_REGISTER struct platform_device *gpio_led_register_device (int id,const struct gpio_led_platform_data *pdata);#else
Signature · 1 line
2.39.2
Re: (subset) [PATCH] leds: fix ifdef check for gpio_led_register_device()
Quoted 6 lines · Arnd Bergmann
gpio_led_register_device()is built wheneverCONFIG_LEDS_GPIO_REGISTERis enabled, and this may be used even whenCONFIG_NEW_LEDSis turned off.However, the stub declaration in the header is provided for all configs without
CONFIG_NEW_LEDS, resulting in a build failure:
Quoted 6 lines
drivers/leds/leds-gpio-register.c:24:1: error: redefinition of 'gpio_led_register_device'
24 |gpio_led_register_device(int id, const struct gpio_led_platform_data *pdata)| ^
include/linux/leds.h:646:39: note: previous definition is here[...]
Applied, thanks!
[1/1] leds: fix ifdef check for gpio_led_register_device()
commit: 71c65d0ff79e3b21cb3eba67d87159533daaadbc
--
Lee Jones [李琼斯]