summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/classmate-laptop.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/platform/x86/classmate-laptop.c')
-rw-r--r--drivers/platform/x86/classmate-laptop.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/platform/x86/classmate-laptop.c b/drivers/platform/x86/classmate-laptop.c
index 035a7dd65a3f..c696cf1c2616 100644
--- a/drivers/platform/x86/classmate-laptop.c
+++ b/drivers/platform/x86/classmate-laptop.c
@@ -455,18 +455,22 @@ static int cmpc_bl_update_status(struct backlight_device *bd)
return -1;
}
-static struct backlight_ops cmpc_bl_ops = {
+static const struct backlight_ops cmpc_bl_ops = {
.get_brightness = cmpc_bl_get_brightness,
.update_status = cmpc_bl_update_status
};
static int cmpc_bl_add(struct acpi_device *acpi)
{
+ struct backlight_properties props;
struct backlight_device *bd;
- bd = backlight_device_register("cmpc_bl", &acpi->dev,
- acpi->handle, &cmpc_bl_ops);
- bd->props.max_brightness = 7;
+ memset(&props, 0, sizeof(struct backlight_properties));
+ props.max_brightness = 7;
+ bd = backlight_device_register("cmpc_bl", &acpi->dev, acpi->handle,
+ &cmpc_bl_ops, &props);
+ if (IS_ERR(bd))
+ return PTR_ERR(bd);
dev_set_drvdata(&acpi->dev, bd);
return 0;
}