From ec57af9c2ece22ae6234189972105d777ff5f939 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bruno=20Pr=C3=A9mont?= Date: Fri, 26 Feb 2010 13:20:10 +0100 Subject: [PATCH] backlight: panasonic-laptop - Fix incomplete registration failure handling MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Properly return backlight registration error to parent. Mark struct backlight_ops as const. Signed-off-by: Bruno Prémont Acked-by: Harald Welte (registration failure) Signed-off-by: Richard Purdie --- drivers/platform/x86/panasonic-laptop.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c index ab5c9ce..726f02a 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, }; @@ -651,8 +651,10 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device) props.max_brightness = pcc->sinf[SINF_AC_MAX_BRIGHT]; pcc->backlight = backlight_device_register("panasonic", NULL, pcc, &pcc_backlight_ops, &props); - if (IS_ERR(pcc->backlight)) + if (IS_ERR(pcc->backlight)) { + result = PTR_ERR(pcc->backlight); goto out_sinf; + } /* read the initial brightness setting from the hardware */ pcc->backlight->props.brightness = pcc->sinf[SINF_AC_CUR_BRIGHT]; -- 2.7.4