diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-20 10:17:32 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-20 10:17:32 -0800 |
commit | a5527c6a586537c1af7ae6db30bb444ee4abdfe8 (patch) | |
tree | f0682de5c461c270f5f58b7304fd5ea5b5d6fb38 /drivers/misc/asus-laptop.c | |
parent | 4afffe5eabc4005674a1ef4f4c96f1ae9f4a979b (diff) | |
parent | 8f27489d1105c2386e6ed71c35e74e0e69603cbc (diff) |
Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight
* 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight:
backlight: Remove bogus SYSFS dependency
backlight: simplify corgi_bl locking
backlight: Separate backlight properties from backlight ops pointers
backlight: Clean up pmac_backlight handling
backlight: Improve backlight selection for fbdev drivers
backlight: Rework backlight/fb interaction simplifying, lots
backlight: Remove unneeded backlight update_status calls
backlight: Remove uneeded update_status call from chipsfb.c
backlight/fbcon: Add FB_EVENT_CONBLANK
backlight: Fix Kconfig entries
backlight: Remove uneeded nvidia set_power calls
backlight: Convert semaphore -> mutex
backlight: Fix external uses of backlight internal semaphore
backlight: Minor code cleanups for hp680_bl.c
backlight: Minor code cleanups for corgi_bl.c
backlight: Remove excessive (un)likelys
backlight: Remove unneeded owner field
backlight: Fix error handling
backlight: Add Frontpath ProGear HX1050+ driver
backlight: Add maintainer entry
Diffstat (limited to 'drivers/misc/asus-laptop.c')
-rw-r--r-- | drivers/misc/asus-laptop.c | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/drivers/misc/asus-laptop.c b/drivers/misc/asus-laptop.c index e4e2b707a353..295e931c0dfb 100644 --- a/drivers/misc/asus-laptop.c +++ b/drivers/misc/asus-laptop.c @@ -195,11 +195,9 @@ static struct backlight_device *asus_backlight_device; */ static int read_brightness(struct backlight_device *bd); static int update_bl_status(struct backlight_device *bd); -static struct backlight_properties asusbl_data = { - .owner = THIS_MODULE, +static struct backlight_ops asusbl_ops = { .get_brightness = read_brightness, .update_status = update_bl_status, - .max_brightness = 15, }; /* These functions actually update the LED's, and are called from a @@ -349,13 +347,8 @@ static void lcd_blank(int blank) struct backlight_device *bd = asus_backlight_device; if (bd) { - down(&bd->sem); - if (likely(bd->props)) { - bd->props->power = blank; - if (likely(bd->props->update_status)) - bd->props->update_status(bd); - } - up(&bd->sem); + bd->props.power = blank; + backlight_update_status(bd); } } @@ -387,13 +380,13 @@ static int set_brightness(struct backlight_device *bd, int value) static int update_bl_status(struct backlight_device *bd) { int rv; - int value = bd->props->brightness; + int value = bd->props.brightness; rv = set_brightness(bd, value); if (rv) return rv; - value = (bd->props->power == FB_BLANK_UNBLANK) ? 1 : 0; + value = (bd->props.power == FB_BLANK_UNBLANK) ? 1 : 0; return set_lcd_state(value); } @@ -1019,7 +1012,7 @@ static int asus_backlight_init(struct device *dev) if (brightness_set_handle && lcd_switch_handle) { bd = backlight_device_register(ASUS_HOTK_FILE, dev, - NULL, &asusbl_data); + NULL, &asusbl_ops); if (IS_ERR(bd)) { printk(ASUS_ERR "Could not register asus backlight device\n"); @@ -1029,14 +1022,10 @@ static int asus_backlight_init(struct device *dev) asus_backlight_device = bd; - down(&bd->sem); - if (likely(bd->props)) { - bd->props->brightness = read_brightness(NULL); - bd->props->power = FB_BLANK_UNBLANK; - if (likely(bd->props->update_status)) - bd->props->update_status(bd); - } - up(&bd->sem); + bd->props.max_brightness = 15; + bd->props.brightness = read_brightness(NULL); + bd->props.power = FB_BLANK_UNBLANK; + backlight_update_status(bd); } return 0; } |