From: Mathieu BĂ©rard Date: Wed, 31 Jan 2007 21:21:37 +0000 (+0000) Subject: * Add support for 2.6.20+ 4 arguments backlight_device_register function X-Git-Url: https://gitweb.devoid-pointer.net/?a=commitdiff_plain;h=1145be3283ecd1ec38fe02d96f085c1aa1aec10b;p=omnibook.git * Add support for 2.6.20+ 4 arguments backlight_device_register function --- diff --git a/lcd.c b/lcd.c index 78706b8..8aade89 100644 --- 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; diff --git a/omnibook.h b/omnibook.h index 812e18a..d9348e8 100644 --- a/omnibook.h +++ b/omnibook.h @@ -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