aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/dell-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/dell-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/dell-laptop.c')
-rw-r--r--drivers/platform/x86/dell-laptop.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index ef614979afe..46435ac4684 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -559,10 +559,14 @@ static int __init dell_init(void)
559 release_buffer(); 559 release_buffer();
560 560
561 if (max_intensity) { 561 if (max_intensity) {
562 dell_backlight_device = backlight_device_register( 562 struct backlight_properties props;
563 "dell_backlight", 563 memset(&props, 0, sizeof(struct backlight_properties));
564 &platform_device->dev, NULL, 564 props.max_brightness = max_intensity;
565 &dell_ops); 565 dell_backlight_device = backlight_device_register("dell_backlight",
566 &platform_device->dev,
567 NULL,
568 &dell_ops,
569 &props);
566 570
567 if (IS_ERR(dell_backlight_device)) { 571 if (IS_ERR(dell_backlight_device)) {
568 ret = PTR_ERR(dell_backlight_device); 572 ret = PTR_ERR(dell_backlight_device);
@@ -570,7 +574,6 @@ static int __init dell_init(void)
570 goto fail_backlight; 574 goto fail_backlight;
571 } 575 }
572 576
573 dell_backlight_device->props.max_brightness = max_intensity;
574 dell_backlight_device->props.brightness = 577 dell_backlight_device->props.brightness =
575 dell_get_intensity(dell_backlight_device); 578 dell_get_intensity(dell_backlight_device);
576 backlight_update_status(dell_backlight_device); 579 backlight_update_status(dell_backlight_device);