linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ACPI / PM: Traverse video_device_list for backlight restoration
@ 2010-08-03 10:05 Matthias Hopf
  2010-08-03 10:11 ` Matthias Hopf
  0 siblings, 1 reply; 4+ messages in thread
From: Matthias Hopf @ 2010-08-03 10:05 UTC (permalink / raw)
  To: Zhang Rui, Len Brown, Matthew Garrett, Andrew Morton,
	Julia Lawall, oneukum
  Cc: linux-acpi, linux-pm, linux-kernel

[-- Attachment #1: 0001-ACPI-PM-Traverse-video_device_list-for-backlight.patch --]
[-- Type: text/x-patch, Size: 1306 bytes --]

.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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-08-04 11:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-03 10:05 [PATCH] ACPI / PM: Traverse video_device_list for backlight restoration Matthias Hopf
2010-08-03 10:11 ` Matthias Hopf
2010-08-04  1:27   ` Zhang Rui
2010-08-04 11:00     ` Matthias Hopf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).