[PATCH] ACPI / PM: Traverse video_device_list for backlightrestoration

From: Matthias Hopf
Date: Tue Aug 03 2010 - 06:05:18 EST


.bind_info in active_list[] is NULL by construction - and used to determine
the acpi_video_device pointer during backlight restoration during resume.

Using the list instead fixes backlight restoration for systems where the BIOS
doesn't do this by itself already.

Signed-off-by: Matthias Hopf <mhopf@xxxxxxx>
---
drivers/acpi/video.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 9865d46..887ac2b 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -2346,7 +2346,6 @@ static int acpi_video_resume(struct notifier_block *nb,
{
struct acpi_video_bus *video;
struct acpi_video_device *video_device;
- int i;

switch (val) {
case PM_HIBERNATION_PREPARE:
@@ -2359,11 +2358,12 @@ static int acpi_video_resume(struct notifier_block *nb,

dev_info(&video->device->dev, "Restoring backlight state\n");

- for (i = 0; i < video->attached_count; i++) {
- video_device = video->attached_array[i].bind_info;
+ mutex_lock(&video->device_list_lock);
+ list_for_each_entry(video_device, &video->video_device_list, entry) {
if (video_device && video_device->backlight)
acpi_video_set_brightness(video_device->backlight);
}
+ mutex_unlock(&video->device_list_lock);

return NOTIFY_OK;
}
--
1.6.0.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/