From 321709c5994f952b78d567fd7083dbebbdc381b7 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sat, 10 Feb 2007 15:04:08 +0000 Subject: 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 --- drivers/misc/sony-laptop.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'drivers/misc/sony-laptop.c') diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c index 03d02bd9f122..2ebe240dd537 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()) -- cgit v1.2.2