From d6b8df4567ba220ebb83a545e080a52cdf14e482 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mathieu=20B=C3=A9rard?= Date: Sun, 4 Mar 2007 17:13:45 +0000 Subject: [PATCH] * backlight API change in 2.6.21-rc : disable backlight binding for now * Update version string * Fix procfs read funtion: for a reason I don't really understand all read methods were called twice. --- init.c | 16 ++++++---------- omnibook.h | 4 ++-- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/init.c b/init.c index 627cdc9..500ddfd 100644 --- a/init.c +++ b/init.c @@ -149,24 +149,20 @@ static int procfile_read_dispatch(char *page, char **start, off_t off, int count void *data) { struct omnibook_feature *feature = (struct omnibook_feature *)data; - int len; + int len = 0; if (!feature || !feature->read) return -EINVAL; + if(off) + goto out; + len = feature->read(page, feature->io_op); if (len < 0) return len; - if (len <= off + count) - *eof = 1; - *start = page + off; - len -= off; - if (len > count) - len = count; - if (len < 0) - len = 0; - + out: + *eof = 1; return len; } diff --git a/omnibook.h b/omnibook.h index 31a727f..64e4030 100644 --- a/omnibook.h +++ b/omnibook.h @@ -26,7 +26,7 @@ */ #define OMNIBOOK_MODULE_NAME "omnibook" -#define OMNIBOOK_MODULE_VERSION "2.20060921-trunk" +#define OMNIBOOK_MODULE_VERSION "2.20070211-trunk" /* * EC types @@ -151,7 +151,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)) +#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,21)) #define CONFIG_OMNIBOOK_BACKLIGHT #else #undef CONFIG_OMNIBOOK_BACKLIGHT -- 2.43.5