[PATCH] backlight, panasonic-laptop: fix incomplete registrationfailure handling

From: Bruno PrÃmont
Date: Fri Feb 26 2010 - 07:22:00 EST


Properly return backlight registration error to parent.
Mark struct backlight_ops as const.

Signed-off-by: Bruno PrÃmont <bonbons@xxxxxxxxxxxxxxxxx>
Acked-by: Harald Welte <laforge@xxxxxxxxxxxx> (registration failure)
---
drivers/platform/x86/panasonic-laptop.c | 4 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c
index 9012d8d..9b17343 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)
return acpi_pcc_write_sset(pcc, SINF_DC_CUR_BRIGHT, bright);
}

-static struct backlight_ops pcc_backlight_ops = {
+static const struct backlight_ops pcc_backlight_ops = {
.get_brightness = bl_get,
.update_status = bl_set_status,
};
@@ -644,8 +644,10 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device)
/* initialize backlight */
pcc->backlight = backlight_device_register("panasonic", NULL, pcc,
&pcc_backlight_ops);
- if (IS_ERR(pcc->backlight))
+ if (IS_ERR(pcc->backlight)) {
+ result = PTR_ERR(pcc->backlight);
goto out_input;
+ }

if (!acpi_pcc_retrieve_biosdata(pcc, pcc->sinf)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
--
1.6.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/