aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/video.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/video.c')
-rw-r--r--drivers/acpi/video.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 2ff2b6ab5b6c..cbe6f3924a10 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -998,6 +998,7 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
998 } 998 }
999 999
1000 if (acpi_video_backlight_support()) { 1000 if (acpi_video_backlight_support()) {
1001 struct backlight_properties props;
1001 int result; 1002 int result;
1002 static int count = 0; 1003 static int count = 0;
1003 char *name; 1004 char *name;
@@ -1010,12 +1011,14 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
1010 return; 1011 return;
1011 1012
1012 sprintf(name, "acpi_video%d", count++); 1013 sprintf(name, "acpi_video%d", count++);
1013 device->backlight = backlight_device_register(name, 1014 memset(&props, 0, sizeof(struct backlight_properties));
1014 NULL, device, &acpi_backlight_ops); 1015 props.max_brightness = device->brightness->count - 3;
1016 device->backlight = backlight_device_register(name, NULL, device,
1017 &acpi_backlight_ops,
1018 &props);
1015 kfree(name); 1019 kfree(name);
1016 if (IS_ERR(device->backlight)) 1020 if (IS_ERR(device->backlight))
1017 return; 1021 return;
1018 device->backlight->props.max_brightness = device->brightness->count-3;
1019 1022
1020 result = sysfs_create_link(&device->backlight->dev.kobj, 1023 result = sysfs_create_link(&device->backlight->dev.kobj,
1021 &device->dev->dev.kobj, "device"); 1024 &device->dev->dev.kobj, "device");