diff options
author | Richard Purdie <rpurdie@rpsys.net> | 2007-02-10 15:04:08 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@rpsys.net> | 2007-02-20 09:26:40 +0000 |
commit | 321709c5994f952b78d567fd7083dbebbdc381b7 (patch) | |
tree | df237c216e8bab6ce5c14d5797a796d4bf889a92 /drivers/misc/sony-laptop.c | |
parent | e0e34ef7f02915cfe50e501e9f32c24217177a96 (diff) |
backlight: Clean up pmac_backlight handling
Move the setting/unsetting of pmac_backlight into the
backlight core instead of doing it in each driver.
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Diffstat (limited to 'drivers/misc/sony-laptop.c')
-rw-r--r-- | drivers/misc/sony-laptop.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c index 03d02bd9f12..2ebe240dd53 100644 --- a/drivers/misc/sony-laptop.c +++ b/drivers/misc/sony-laptop.c @@ -384,7 +384,7 @@ static void sony_snc_pf_remove(void) static int sony_backlight_update_status(struct backlight_device *bd) { return acpi_callsetfunc(sony_acpi_handle, "SBRT", - bd->props->brightness + 1, NULL); + bd->props.brightness + 1, NULL); } static int sony_backlight_get_brightness(struct backlight_device *bd) @@ -398,10 +398,9 @@ static int sony_backlight_get_brightness(struct backlight_device *bd) } static struct backlight_device *sony_backlight_device; -static struct backlight_properties sony_backlight_properties = { +static struct backlight_ops sony_backlight_ops = { .update_status = sony_backlight_update_status, .get_brightness = sony_backlight_get_brightness, - .max_brightness = SONY_MAX_BRIGHTNESS - 1, }; /* @@ -483,15 +482,19 @@ static int sony_acpi_add(struct acpi_device *device) if (ACPI_SUCCESS(acpi_get_handle(sony_acpi_handle, "GBRT", &handle))) { sony_backlight_device = backlight_device_register("sony", NULL, NULL, - &sony_backlight_properties); + &sony_backlight_ops); if (IS_ERR(sony_backlight_device)) { printk(LOG_PFX "unable to register backlight device\n"); sony_backlight_device = NULL; - } else - sony_backlight_properties.brightness = + } else { + sony_backlight_device->props.brightness = sony_backlight_get_brightness (sony_backlight_device); + sony_backlight_device->props.max_brightness = + SONY_MAX_BRIGHTNESS - 1; + } + } if (sony_snc_pf_add()) |