X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=drivers%2Fplatform%2Fx86%2Fclassmate-laptop.c;h=7f9e5ddc949841ba3c80d15aa75d94a60e9385c0;hb=5a0e3ad6af8660be21ca98a971cd00f331318c05;hp=035a7dd65a3fdf87d08305b9f0d663446240d4cd;hpb=e213e26ab3988c516c06eba4dcd030ac052f6dc9;p=mv-sheeva.git diff --git a/drivers/platform/x86/classmate-laptop.c b/drivers/platform/x86/classmate-laptop.c index 035a7dd65a3..7f9e5ddc949 100644 --- a/drivers/platform/x86/classmate-laptop.c +++ b/drivers/platform/x86/classmate-laptop.c @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -455,18 +456,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; }