From: Andrew F. Davis Date: Tue, 21 Jun 2016 12:40:11 +0000 (+0200) Subject: leds: Add no-op gpio_led_register_device when LED subsystem is disabled X-Git-Tag: v4.14-rc1~2812^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fca23e47dfdbcdacaae523f8b87d2240ce056ac1;p=platform%2Fkernel%2Flinux-rpi.git leds: Add no-op gpio_led_register_device when LED subsystem is disabled Some systems use 'gpio_led_register_device' to make an in-memory copy of their LED device table so the original can be removed as .init.rodata. When the LED subsystem is not enabled source in the led directory is not built and so this function may be undefined. Fix this here. Signed-off-by: Andrew F. Davis Signed-off-by: Jacek Anaszewski --- diff --git a/include/linux/leds.h b/include/linux/leds.h index 0aa3701..8a3b5d2 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h @@ -387,8 +387,16 @@ struct gpio_led_platform_data { unsigned long *delay_off); }; +#ifdef CONFIG_NEW_LEDS struct platform_device *gpio_led_register_device( int id, const struct gpio_led_platform_data *pdata); +#else +static inline struct platform_device *gpio_led_register_device( + int id, const struct gpio_led_platform_data *pdata) +{ + return 0; +} +#endif enum cpu_led_event { CPU_LED_IDLE_START, /* CPU enters idle */