backports: fix led_trigger warning with old kernel versions
authorHauke Mehrtens <hauke@hauke-m.de>
Sun, 19 Jan 2014 13:57:23 +0000 (14:57 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 19 Jan 2014 16:47:13 +0000 (17:47 +0100)
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 <hauke@hauke-m.de>
backport/backport-include/backport/leds-disabled.h

index 1a9abeccf32e36c62e5d71c7b8eab4a19bbfb253..634b62f43599054c0c1b1b7a4edc7dfc37a30528 100644 (file)
@@ -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)