From patchwork Tue Aug 3 10:05:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Hopf X-Patchwork-Id: 116712 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o73A5Amj022467 for ; Tue, 3 Aug 2010 10:05:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755566Ab0HCKFJ (ORCPT ); Tue, 3 Aug 2010 06:05:09 -0400 Received: from cantor2.suse.de ([195.135.220.15]:36345 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755546Ab0HCKFH (ORCPT ); Tue, 3 Aug 2010 06:05:07 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id 6B1FF87104; Tue, 3 Aug 2010 12:05:06 +0200 (CEST) Date: Tue, 3 Aug 2010 12:05:05 +0200 From: Matthias Hopf To: Zhang Rui , Len Brown , Matthew Garrett , Andrew Morton , Julia Lawall , 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 Message-ID: <20100803100505.GA26948@suse.de> Mail-Followup-To: Zhang Rui , Len Brown , Matthew Garrett , Andrew Morton , Julia Lawall , oneukum@suse.de, linux-acpi@vger.kernel.org, linux-pm@lists.linux-foundation.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Content-Disposition: attachment; filename="0001-ACPI-PM-Traverse-video_device_list-for-backlight.patch" Organization: SUSE LINUX Products GmbH, =?iso-8859-1?Q?G?= =?iso-8859-1?Q?F=3A_Markus_Rex=2C_HRB_16746_=28AG_N=FCrnberg=29?= User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 03 Aug 2010 10:05:11 +0000 (UTC) .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 --- 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-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html