aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/classmate-laptop.c
diff options
context:
space:
mode:
authorMatthew Garrett <mjg@redhat.com>2010-02-17 16:39:44 -0500
committerRichard Purdie <rpurdie@linux.intel.com>2010-03-16 15:47:54 -0400
commita19a6ee6cad2b20292a774c2f56ba8039b0fac9c (patch)
tree631916ce6181336c5c28eb0cf5484c40c92986b6 /drivers/platform/x86/classmate-laptop.c
parent57e148b6a975980944f4466ccb669b1d02dfc6a1 (diff)
backlight: Allow properties to be passed at registration
Values such as max_brightness should be set before backlights are registered, but the current API doesn't allow that. Add a parameter to backlight_device_register and update drivers to ensure that they set this correctly. Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'drivers/platform/x86/classmate-laptop.c')
-rw-r--r--drivers/platform/x86/classmate-laptop.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/platform/x86/classmate-laptop.c b/drivers/platform/x86/classmate-laptop.c
index 035a7dd65a3f..6670ed8f9e5b 100644
--- a/drivers/platform/x86/classmate-laptop.c
+++ b/drivers/platform/x86/classmate-laptop.c
@@ -462,11 +462,13 @@ static struct backlight_ops cmpc_bl_ops = {
462 462
463static int cmpc_bl_add(struct acpi_device *acpi) 463static int cmpc_bl_add(struct acpi_device *acpi)
464{ 464{
465 struct backlight_properties props;
465 struct backlight_device *bd; 466 struct backlight_device *bd;
466 467
467 bd = backlight_device_register("cmpc_bl", &acpi->dev, 468 memset(&props, 0, sizeof(struct backlight_properties));
468 acpi->handle, &cmpc_bl_ops); 469 props.max_brightness = 7;
469 bd->props.max_brightness = 7; 470 bd = backlight_device_register("cmpc_bl", &acpi->dev, acpi->handle,
471 &cmpc_bl_ops, &props);
470 dev_set_drvdata(&acpi->dev, bd); 472 dev_set_drvdata(&acpi->dev, bd);
471 return 0; 473 return 0;
472} 474}