Skip to content

Commit 08b7dab

Browse files
arndblag-linaro
authored andcommitted
leds: Fix ifdef check for gpio_led_register_device()
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. Signed-off-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent 6c27bf4 commit 08b7dab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/leds.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ struct gpio_led_platform_data {
639639
gpio_blink_set_t gpio_blink_set;
640640
};
641641

642-
#ifdef CONFIG_NEW_LEDS
642+
#ifdef CONFIG_LEDS_GPIO_REGISTER
643643
struct platform_device *gpio_led_register_device(
644644
int id, const struct gpio_led_platform_data *pdata);
645645
#else

0 commit comments

Comments
 (0)