diff options
author | Bruno Prémont <bonbons@linux-vserver.org> | 2010-02-26 07:17:16 -0500 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-03-16 16:12:11 -0400 |
commit | 28d85873cd6d8d3176e30e02b941b1329df1024c (patch) | |
tree | 40be9e9db78823cfde9b5df0e18046ae0a67002a /drivers | |
parent | fa11de0a33e214a00e205494c27fb5a7bb71a5fa (diff) |
backlight: msi-laptop, msi-wmi: fix incomplete registration failure handling
Properly return backlight registration error to parent.
Mark struct backlight_ops as const.
Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Reviewed-by: Anisse Astier <anisse@astier.eu>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/platform/x86/msi-wmi.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/platform/x86/msi-wmi.c b/drivers/platform/x86/msi-wmi.c index fb7ccaae6563..367caaae2f3c 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) | |||
138 | return msi_wmi_set_block(0, backlight_map[bright]); | 138 | return msi_wmi_set_block(0, backlight_map[bright]); |
139 | } | 139 | } |
140 | 140 | ||
141 | static struct backlight_ops msi_backlight_ops = { | 141 | static const struct backlight_ops msi_backlight_ops = { |
142 | .get_brightness = bl_get, | 142 | .get_brightness = bl_get, |
143 | .update_status = bl_set_status, | 143 | .update_status = bl_set_status, |
144 | }; | 144 | }; |
@@ -255,8 +255,10 @@ static int __init msi_wmi_init(void) | |||
255 | backlight = backlight_device_register(DRV_NAME, NULL, NULL, | 255 | backlight = backlight_device_register(DRV_NAME, NULL, NULL, |
256 | &msi_backlight_ops, | 256 | &msi_backlight_ops, |
257 | &props); | 257 | &props); |
258 | if (IS_ERR(backlight)) | 258 | if (IS_ERR(backlight)) { |
259 | err = PTR_ERR(backlight); | ||
259 | goto err_free_input; | 260 | goto err_free_input; |
261 | } | ||
260 | 262 | ||
261 | err = bl_get(NULL); | 263 | err = bl_get(NULL); |
262 | if (err < 0) | 264 | if (err < 0) |