diff options
author | Bruno Prémont <bonbons@linux-vserver.org> | 2010-02-26 06:59:39 -0500 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-03-16 16:04:07 -0400 |
commit | f0af78991363d704694a3618b638662c97d8a110 (patch) | |
tree | 8ce2e6618ba87536d11d43136f25bcadd932c585 /drivers/platform | |
parent | 36bc5ee6a8d13333980fa54e97d3469d3d4cda98 (diff) |
backlight: classmate-laptop - Fix missing registration failure handling
Check newly registered backlight_device for error and properly
return error to parent.
Mark struct backlight_ops as const.
Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/classmate-laptop.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/platform/x86/classmate-laptop.c b/drivers/platform/x86/classmate-laptop.c index 6670ed8f9e5..c696cf1c261 100644 --- a/drivers/platform/x86/classmate-laptop.c +++ b/drivers/platform/x86/classmate-laptop.c | |||
@@ -455,7 +455,7 @@ static int cmpc_bl_update_status(struct backlight_device *bd) | |||
455 | return -1; | 455 | return -1; |
456 | } | 456 | } |
457 | 457 | ||
458 | static struct backlight_ops cmpc_bl_ops = { | 458 | static const struct backlight_ops cmpc_bl_ops = { |
459 | .get_brightness = cmpc_bl_get_brightness, | 459 | .get_brightness = cmpc_bl_get_brightness, |
460 | .update_status = cmpc_bl_update_status | 460 | .update_status = cmpc_bl_update_status |
461 | }; | 461 | }; |
@@ -469,6 +469,8 @@ static int cmpc_bl_add(struct acpi_device *acpi) | |||
469 | props.max_brightness = 7; | 469 | props.max_brightness = 7; |
470 | bd = backlight_device_register("cmpc_bl", &acpi->dev, acpi->handle, | 470 | bd = backlight_device_register("cmpc_bl", &acpi->dev, acpi->handle, |
471 | &cmpc_bl_ops, &props); | 471 | &cmpc_bl_ops, &props); |
472 | if (IS_ERR(bd)) | ||
473 | return PTR_ERR(bd); | ||
472 | dev_set_drvdata(&acpi->dev, bd); | 474 | dev_set_drvdata(&acpi->dev, bd); |
473 | return 0; | 475 | return 0; |
474 | } | 476 | } |