diff options
author | Bruno Prémont <bonbons@linux-vserver.org> | 2010-02-26 07:20:10 -0500 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-03-16 16:13:31 -0400 |
commit | ec57af9c2ece22ae6234189972105d777ff5f939 (patch) | |
tree | 73979ad29548c133273a3130d6d10aa25591d5be /drivers/platform | |
parent | 28d85873cd6d8d3176e30e02b941b1329df1024c (diff) |
backlight: panasonic-laptop - 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>
Acked-by: Harald Welte <laforge@gnumonks.org> (registration failure)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/panasonic-laptop.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c index ab5c9cea1462..726f02affcb6 100644 --- a/drivers/platform/x86/panasonic-laptop.c +++ b/drivers/platform/x86/panasonic-laptop.c | |||
@@ -352,7 +352,7 @@ static int bl_set_status(struct backlight_device *bd) | |||
352 | return acpi_pcc_write_sset(pcc, SINF_DC_CUR_BRIGHT, bright); | 352 | return acpi_pcc_write_sset(pcc, SINF_DC_CUR_BRIGHT, bright); |
353 | } | 353 | } |
354 | 354 | ||
355 | static struct backlight_ops pcc_backlight_ops = { | 355 | static const struct backlight_ops pcc_backlight_ops = { |
356 | .get_brightness = bl_get, | 356 | .get_brightness = bl_get, |
357 | .update_status = bl_set_status, | 357 | .update_status = bl_set_status, |
358 | }; | 358 | }; |
@@ -651,8 +651,10 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device) | |||
651 | props.max_brightness = pcc->sinf[SINF_AC_MAX_BRIGHT]; | 651 | props.max_brightness = pcc->sinf[SINF_AC_MAX_BRIGHT]; |
652 | pcc->backlight = backlight_device_register("panasonic", NULL, pcc, | 652 | pcc->backlight = backlight_device_register("panasonic", NULL, pcc, |
653 | &pcc_backlight_ops, &props); | 653 | &pcc_backlight_ops, &props); |
654 | if (IS_ERR(pcc->backlight)) | 654 | if (IS_ERR(pcc->backlight)) { |
655 | result = PTR_ERR(pcc->backlight); | ||
655 | goto out_sinf; | 656 | goto out_sinf; |
657 | } | ||
656 | 658 | ||
657 | /* read the initial brightness setting from the hardware */ | 659 | /* read the initial brightness setting from the hardware */ |
658 | pcc->backlight->props.brightness = pcc->sinf[SINF_AC_CUR_BRIGHT]; | 660 | pcc->backlight->props.brightness = pcc->sinf[SINF_AC_CUR_BRIGHT]; |