compat: fix build for kernel <= 2.6.29
authorHauke Mehrtens <hauke@hauke-m.de>
Wed, 1 Dec 2010 15:03:30 +0000 (16:03 +0100)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Wed, 1 Dec 2010 22:28:07 +0000 (14:28 -0800)
The max_brightness member in struct led_classdev was added in kernel
2.6.30, so use LED_FULL for older kernel versions.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
compat/compat-2.6.37.c

index a522b4e..8636c65 100644 (file)
@@ -281,7 +281,11 @@ void led_blink_set(struct led_classdev *led_cdev,
        if (current_brightness)
                led->blink_brightness = current_brightness;
        if (!led->blink_brightness)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30)
                led->blink_brightness = led_cdev->max_brightness;
+#else
+               led->blink_brightness = LED_FULL;
+#endif
 
        led_stop_software_blink(led);
        led->blink_delay_on = *delay_on;