diff options
| author | Matthew Garrett <matthew.garrett@nebula.com> | 2013-07-16 13:08:16 -0400 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-07-17 19:31:47 -0400 |
| commit | c04c697cf1fe8f0962ccd3c2392a9b637a5307aa (patch) | |
| tree | ef888dace57a4b832a10eae7657c3e76fb5d8114 | |
| parent | 242b2287cd7f27521c8b54a4101d569e53e7a0ca (diff) | |
ACPI / video: Always call acpi_video_init_brightness() on init
We have to call acpi_video_init_brightness() even if we're not going
to initialise the backlight - Thinkpads seem to use this as the
trigger for enabling ACPI notifications rather than handling it in
firmware.
[rjw: Drop the brightness object created by
acpi_video_init_brightness() if we are not going to use it.]
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| -rw-r--r-- | drivers/acpi/video.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 5d7075d25700..f236e172d948 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
| @@ -898,6 +898,9 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) | |||
| 898 | device->cap._DDC = 1; | 898 | device->cap._DDC = 1; |
| 899 | } | 899 | } |
| 900 | 900 | ||
| 901 | if (acpi_video_init_brightness(device)) | ||
| 902 | return; | ||
| 903 | |||
| 901 | if (acpi_video_backlight_support()) { | 904 | if (acpi_video_backlight_support()) { |
| 902 | struct backlight_properties props; | 905 | struct backlight_properties props; |
| 903 | struct pci_dev *pdev; | 906 | struct pci_dev *pdev; |
| @@ -907,9 +910,6 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) | |||
| 907 | static int count = 0; | 910 | static int count = 0; |
| 908 | char *name; | 911 | char *name; |
| 909 | 912 | ||
| 910 | result = acpi_video_init_brightness(device); | ||
| 911 | if (result) | ||
| 912 | return; | ||
| 913 | name = kasprintf(GFP_KERNEL, "acpi_video%d", count); | 913 | name = kasprintf(GFP_KERNEL, "acpi_video%d", count); |
| 914 | if (!name) | 914 | if (!name) |
| 915 | return; | 915 | return; |
| @@ -969,6 +969,11 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) | |||
| 969 | if (result) | 969 | if (result) |
| 970 | printk(KERN_ERR PREFIX "Create sysfs link\n"); | 970 | printk(KERN_ERR PREFIX "Create sysfs link\n"); |
| 971 | 971 | ||
| 972 | } else { | ||
| 973 | /* Remove the brightness object. */ | ||
| 974 | kfree(device->brightness->levels); | ||
| 975 | kfree(device->brightness); | ||
| 976 | device->brightness = NULL; | ||
| 972 | } | 977 | } |
| 973 | } | 978 | } |
| 974 | 979 | ||
