From: Matthias Hopf <mhopf@suse.de>
To: Zhang Rui <rui.zhang@intel.com>, Len Brown <lenb@kernel.org>,
Matthew Garrett <mjg@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
Julia Lawall <julia@diku.dk>,
oneukum@suse.de
Cc: linux-acpi@vger.kernel.org, linux-pm@lists.linux-foundation.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] ACPI / PM: Traverse video_device_list for backlight restoration
Date: Tue, 3 Aug 2010 12:05:05 +0200 [thread overview]
Message-ID: <20100803100505.GA26948@suse.de> (raw)
[-- 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
next reply other threads:[~2010-08-03 10:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-03 10:05 Matthias Hopf [this message]
2010-08-03 10:11 ` [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 1:27 ` Zhang Rui
2010-08-04 11:00 ` Matthias Hopf
2010-08-04 11:00 ` Matthias Hopf
2010-08-03 10:11 ` Matthias Hopf
-- strict thread matches above, loose matches on Subject: below --
2010-08-03 10:05 Matthias Hopf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100803100505.GA26948@suse.de \
--to=mhopf@suse.de \
--cc=akpm@linux-foundation.org \
--cc=julia@diku.dk \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=mjg@redhat.com \
--cc=oneukum@suse.de \
--cc=rui.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.