Commit ec57af9c authored by Bruno Prémont's avatar Bruno Prémont Committed by Richard Purdie

backlight: panasonic-laptop - Fix incomplete registration failure handling

Properly return backlight registration error to parent.
Mark struct backlight_ops as const.
Signed-off-by: default avatarBruno Prémont <bonbons@linux-vserver.org>
Acked-by: Harald Welte <laforge@gnumonks.org> (registration failure)
Signed-off-by: default avatarRichard Purdie <rpurdie@linux.intel.com>
parent 28d85873
...@@ -352,7 +352,7 @@ static int bl_set_status(struct backlight_device *bd) ...@@ -352,7 +352,7 @@ static int bl_set_status(struct backlight_device *bd)
return acpi_pcc_write_sset(pcc, SINF_DC_CUR_BRIGHT, bright); 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, .get_brightness = bl_get,
.update_status = bl_set_status, .update_status = bl_set_status,
}; };
...@@ -651,8 +651,10 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device) ...@@ -651,8 +651,10 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device)
props.max_brightness = pcc->sinf[SINF_AC_MAX_BRIGHT]; props.max_brightness = pcc->sinf[SINF_AC_MAX_BRIGHT];
pcc->backlight = backlight_device_register("panasonic", NULL, pcc, pcc->backlight = backlight_device_register("panasonic", NULL, pcc,
&pcc_backlight_ops, &props); &pcc_backlight_ops, &props);
if (IS_ERR(pcc->backlight)) if (IS_ERR(pcc->backlight)) {
result = PTR_ERR(pcc->backlight);
goto out_sinf; goto out_sinf;
}
/* read the initial brightness setting from the hardware */ /* read the initial brightness setting from the hardware */
pcc->backlight->props.brightness = pcc->sinf[SINF_AC_CUR_BRIGHT]; pcc->backlight->props.brightness = pcc->sinf[SINF_AC_CUR_BRIGHT];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment