* [PATCH] leds: fix ifdef check for gpio_led_register_device()
@ 2024-02-28 9:38 Arnd Bergmann
2024-02-29 17:43 ` (subset) " Lee Jones
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2024-02-28 9:38 UTC (permalink / raw)
To: Pavel Machek, Lee Jones
Cc: Arnd Bergmann, Andrew Lunn, Christian Marangi, David S. Miller,
Jacek Anaszewski, Hans de Goede, Jean-Jacques Hiblot,
Heiner Kallweit, linux-leds, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
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 <arnd@arndb.de>
---
include/linux/leds.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/leds.h b/include/linux/leds.h
index 7598d472903a..db6b114bb3d9 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -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
--
2.39.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: (subset) [PATCH] leds: fix ifdef check for gpio_led_register_device()
2024-02-28 9:38 [PATCH] leds: fix ifdef check for gpio_led_register_device() Arnd Bergmann
@ 2024-02-29 17:43 ` Lee Jones
0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2024-02-29 17:43 UTC (permalink / raw)
To: Pavel Machek, Arnd Bergmann
Cc: Arnd Bergmann, Andrew Lunn, Christian Marangi, David S. Miller,
Jacek Anaszewski, Hans de Goede, Jean-Jacques Hiblot,
Heiner Kallweit, linux-leds, linux-kernel
On Wed, 28 Feb 2024 10:38:26 +0100, Arnd Bergmann wrote:
> 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
>
> [...]
Applied, thanks!
[1/1] leds: fix ifdef check for gpio_led_register_device()
commit: 71c65d0ff79e3b21cb3eba67d87159533daaadbc
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-02-29 17:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-28 9:38 [PATCH] leds: fix ifdef check for gpio_led_register_device() Arnd Bergmann
2024-02-29 17:43 ` (subset) " Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox