Skip to content

Commit

Permalink
backlight: msi-laptop, msi-wmi: fix incomplete registration failure h…
Browse files Browse the repository at this point in the history
…andling

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>
  • Loading branch information
Bruno Prémont authored and Richard Purdie committed Mar 16, 2010
1 parent fa11de0 commit 28d8587
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/platform/x86/msi-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down Expand Up @@ -255,8 +255,10 @@ static int __init msi_wmi_init(void)
backlight = backlight_device_register(DRV_NAME, NULL, NULL,
&msi_backlight_ops,
&props);
if (IS_ERR(backlight))
if (IS_ERR(backlight)) {
err = PTR_ERR(backlight);
goto err_free_input;
}

err = bl_get(NULL);
if (err < 0)
Expand Down

0 comments on commit 28d8587

Please sign in to comment.