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.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 05dff631591c..72e76b4b6538 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -999,8 +999,10 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
999 sprintf(name, "acpi_video%d", count++); 999 sprintf(name, "acpi_video%d", count++);
1000 device->backlight = backlight_device_register(name, 1000 device->backlight = backlight_device_register(name,
1001 NULL, device, &acpi_backlight_ops); 1001 NULL, device, &acpi_backlight_ops);
1002 device->backlight->props.max_brightness = device->brightness->count-3;
1003 kfree(name); 1002 kfree(name);
1003 if (IS_ERR(device->backlight))
1004 return;
1005 device->backlight->props.max_brightness = device->brightness->count-3;
1004 1006
1005 result = sysfs_create_link(&device->backlight->dev.kobj, 1007 result = sysfs_create_link(&device->backlight->dev.kobj,
1006 &device->dev->dev.kobj, "device"); 1008 &device->dev->dev.kobj, "device");
@@ -1979,6 +1981,10 @@ acpi_video_switch_brightness(struct acpi_video_device *device, int event)
1979 unsigned long long level_current, level_next; 1981 unsigned long long level_current, level_next;
1980 int result = -EINVAL; 1982 int result = -EINVAL;
1981 1983
1984 /* no warning message if acpi_backlight=vendor is used */
1985 if (!acpi_video_backlight_support())
1986 return 0;
1987
1982 if (!device->brightness) 1988 if (!device->brightness)
1983 goto out; 1989 goto out;
1984 1990