backlight: Allow properties to be passed at registration
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / platform / x86 / compal-laptop.c
index 2740b40aad9b318bbaf289357c197b6294323bf8..71ff1545a93e0a87e3c0ea80953e909c7f901424 100644 (file)
@@ -291,12 +291,15 @@ static int __init compal_init(void)
        /* Register backlight stuff */
 
        if (!acpi_video_backlight_support()) {
-               compalbl_device = backlight_device_register("compal-laptop", NULL, NULL,
-                                                           &compalbl_ops);
+               struct backlight_properties props;
+               memset(&props, 0, sizeof(struct backlight_properties));
+               props.max_brightness = COMPAL_LCD_LEVEL_MAX - 1;
+               compalbl_device = backlight_device_register("compal-laptop",
+                                                           NULL, NULL,
+                                                           &compalbl_ops,
+                                                           &props);
                if (IS_ERR(compalbl_device))
                        return PTR_ERR(compalbl_device);
-
-               compalbl_device->props.max_brightness = COMPAL_LCD_LEVEL_MAX-1;
        }
 
        ret = platform_driver_register(&compal_driver);