]> Devoid-pointer.net GitWeb - omnibook.git/commitdiff
* Add support for 2.6.20+ 4 arguments backlight_device_register function
authorMathieu Bérard <mathieu.berard@crans.org>
Wed, 31 Jan 2007 21:21:37 +0000 (21:21 +0000)
committerMathieu Bérard <mathieu.berard@crans.org>
Wed, 31 Jan 2007 21:21:37 +0000 (21:21 +0000)
lcd.c
omnibook.h

diff --git a/lcd.c b/lcd.c
index 78706b84c2c7f38d563e3add4c569ff2ed372005..8aade89b0f42a01c4774707d29a71ad3a6aebd65 100644 (file)
--- a/lcd.c
+++ b/lcd.c
@@ -126,8 +126,13 @@ static int __init omnibook_brightness_init(struct omnibook_operation *io_op)
 #ifdef CONFIG_OMNIBOOK_BACKLIGHT
        backend_byte_read(io_op, (u8*) &omnibookbl_data.brightness);
        omnibookbl_data.max_brightness = omnibook_max_brightness;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
+       omnibook_backlight_device =
+           backlight_device_register(OMNIBOOK_MODULE_NAME, NULL, (void *)io_op, &omnibookbl_data);
+#else
        omnibook_backlight_device =
            backlight_device_register(OMNIBOOK_MODULE_NAME, (void *)io_op, &omnibookbl_data);
+#endif
        if (IS_ERR(omnibook_backlight_device)) {
                printk(O_ERR "Unable to register as backlight device.\n");
                return -ENODEV;
index 812e18a7ee9127f0686d1fac603e39d698fa5a41..d9348e876dafa2345f90e3b86484bcda05ee64cb 100644 (file)
@@ -160,7 +160,7 @@ void omnibook_report_key(struct input_dev *dev, unsigned int keycode);
  */
 
 #ifdef  OMNIBOOK_STANDALONE
-#if     (defined (CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE)) && (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16)) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
+#if     (defined (CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE)) && (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16))
 #define CONFIG_OMNIBOOK_BACKLIGHT
 #else
 #undef  CONFIG_OMNIBOOK_BACKLIGHT