From: Hauke Mehrtens Date: Sun, 19 Jan 2014 13:57:23 +0000 (+0100) Subject: backports: fix led_trigger warning with old kernel versions X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=e16514c910f331700139a86a7c71e3242333c53b;p=openwrt%2Fstaging%2Fblogic.git backports: fix led_trigger warning with old kernel versions This fixes the following warning: /drivers/net/wireless/at76c50x-usb.c: In function ‘at76_mod_init’: /drivers/net/wireless/at76c50x-usb.c:2472:2: warning: passing argument 2 of ‘led_trigger_register_simple’ from incompatible pointer type [enabled by default] led_trigger_register_simple("at76_usb-tx", &ledtrig_tx); ^ In file included from /backport-include/linux/leds.h:3:0, from /drivers/net/wireless/at76c50x-usb.c:45: include/linux/leds.h:97:13: note: expected ‘struct led_trigger **’ but argument is of type ‘struct backport_led_trigger **’ extern void led_trigger_register_simple(const char *name, ^ /drivers/net/wireless/at76c50x-usb.c: In function ‘at76_mod_exit’: /drivers/net/wireless/at76c50x-usb.c:2484:2: warning: passing argument 1 of ‘led_trigger_unregister_simple’ from incompatible pointer type [enabled by default] led_trigger_unregister_simple(ledtrig_tx); ^ In file included from /backport-include/linux/leds.h:3:0, from /drivers/net/wireless/at76c50x-usb.c:45: include/linux/leds.h:99:13: note: expected ‘struct led_trigger *’ but argument is of type ‘struct backport_led_trigger *’ extern void led_trigger_unregister_simple(struct led_trigger *trigger); ^ Signed-off-by: Hauke Mehrtens --- diff --git a/backport/backport-include/backport/leds-disabled.h b/backport/backport-include/backport/leds-disabled.h index 1a9abeccf32e..634b62f43599 100644 --- a/backport/backport-include/backport/leds-disabled.h +++ b/backport/backport-include/backport/leds-disabled.h @@ -99,6 +99,10 @@ struct led_trigger { #define led_trigger_register LINUX_BACKPORT(led_trigger_register) #undef led_trigger_unregister #define led_trigger_unregister LINUX_BACKPORT(led_trigger_unregister) +#undef led_trigger_register_simple +#define led_trigger_register_simple LINUX_BACKPORT(led_trigger_register_simple) +#undef led_trigger_unregister_simple +#define led_trigger_unregister_simple LINUX_BACKPORT(led_trigger_unregister_simple) #undef led_trigger_event #define led_trigger_event LINUX_BACKPORT(led_trigger_event) @@ -115,6 +119,15 @@ static inline void led_classdev_unregister(struct led_classdev *led_cdev) { } +static inline void led_trigger_register_simple(const char *name, + struct led_trigger **trigger) +{ +} + +static inline void led_trigger_unregister_simple(struct led_trigger *trigger) +{ +} + static inline void led_blink_set(struct led_classdev *led_cdev, unsigned long *delay_on, unsigned long *delay_off)