diff options
author | Matthew Garrett <mjg@redhat.com> | 2010-02-18 00:39:44 +0300 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-03-16 22:47:54 +0300 |
commit | a19a6ee6cad2b20292a774c2f56ba8039b0fac9c (patch) | |
tree | 631916ce6181336c5c28eb0cf5484c40c92986b6 /drivers/platform/x86/msi-wmi.c | |
parent | 57e148b6a975980944f4466ccb669b1d02dfc6a1 (diff) | |
download | linux-a19a6ee6cad2b20292a774c2f56ba8039b0fac9c.tar.xz |
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/msi-wmi.c')
-rw-r--r-- | drivers/platform/x86/msi-wmi.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/platform/x86/msi-wmi.c b/drivers/platform/x86/msi-wmi.c index f5f70d4c6913..fb7ccaae6563 100644 --- a/drivers/platform/x86/msi-wmi.c +++ b/drivers/platform/x86/msi-wmi.c @@ -249,12 +249,15 @@ static int __init msi_wmi_init(void) goto err_uninstall_notifier; if (!acpi_video_backlight_support()) { - backlight = backlight_device_register(DRV_NAME, - NULL, NULL, &msi_backlight_ops); + struct backlight_properties props; + memset(&props, 0, sizeof(struct backlight_properties)); + props.max_brightness = ARRAY_SIZE(backlight_map) - 1; + backlight = backlight_device_register(DRV_NAME, NULL, NULL, + &msi_backlight_ops, + &props); if (IS_ERR(backlight)) goto err_free_input; - backlight->props.max_brightness = ARRAY_SIZE(backlight_map) - 1; err = bl_get(NULL); if (err < 0) goto err_free_backlight; |