lkml.org 
[lkml]   [2010]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] ACPI / PM: Traverse video_device_list for backlight restoration
.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@suse.de>
---
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


\
 
 \ /
  Last update: 2010-08-03 12:07    [W:0.168 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site