backlight: Separate backlight properties from backlight ops pointers
Per device data such as brightness belongs to the indivdual device
and should therefore be separate from the the backlight operation
function pointers. This patch splits the two types of data and
allows simplifcation of some code.
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c
index accf4f7..4cc534e 100644
--- a/drivers/acpi/ibm_acpi.c
+++ b/drivers/acpi/ibm_acpi.c
@@ -1701,13 +1701,12 @@
static int brightness_update_status(struct backlight_device *bd)
{
- return brightness_set(bd->props->brightness);
+ return brightness_set(bd->props.brightness);
}
-static struct backlight_properties ibm_backlight_data = {
+static struct backlight_ops ibm_backlight_data = {
.get_brightness = brightness_get,
.update_status = brightness_update_status,
- .max_brightness = 7,
};
static int brightness_init(void)
@@ -1719,6 +1718,8 @@
return PTR_ERR(ibm_backlight_device);
}
+ ibm_backlight_device->props.max_brightness = 7;
+
return 0;
}