aboutsummaryrefslogtreecommitdiff
path: root/drivers/platform/x86/msi-wmi.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-03-18 16:48:00 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-18 16:48:00 -0700
commit61d718076e95eb461fd4c3692b702a82e2be0df4 (patch)
tree7c5d489840c85692bf2d14eda120cb0cb0e673c0 /drivers/platform/x86/msi-wmi.c
parent5dbc2f543d2eb5499f3839d1abb72105cf0c03af (diff)
parentec57af9c2ece22ae6234189972105d777ff5f939 (diff)
Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight
* 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight: backlight: panasonic-laptop - Fix incomplete registration failure handling backlight: msi-laptop, msi-wmi: fix incomplete registration failure handling backlight: blackfin - Fix missing registration failure handling backlight: classmate-laptop - Fix missing registration failure handling backlight: mbp_nvidia_bl - add five more MacBook variants backlight: Allow properties to be passed at registration backlight: Add backlight_device parameter to check_fb video: backlight/progear, fix pci device refcounting backlight: l4f00242t03: Fix module licence absence. backlight: Revert some const qualifiers backlight: Add Epson L4F00242T03 LCD driver
Diffstat (limited to 'drivers/platform/x86/msi-wmi.c')
-rw-r--r--drivers/platform/x86/msi-wmi.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/platform/x86/msi-wmi.c b/drivers/platform/x86/msi-wmi.c
index f5f70d4c691..367caaae2f3 100644
--- a/drivers/platform/x86/msi-wmi.c
+++ b/drivers/platform/x86/msi-wmi.c
@@ -138,7 +138,7 @@ static int bl_set_status(struct backlight_device *bd)
return msi_wmi_set_block(0, backlight_map[bright]);
}
-static struct backlight_ops msi_backlight_ops = {
+static const struct backlight_ops msi_backlight_ops = {
.get_brightness = bl_get,
.update_status = bl_set_status,
};
@@ -249,12 +249,17 @@ 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);
- if (IS_ERR(backlight))
+ 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)) {
+ err = PTR_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;