From patchwork Wed Nov 6 01:03:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Lu X-Patchwork-Id: 3144531 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9CFF5BEEB2 for ; Wed, 6 Nov 2013 01:02:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9662C205B3 for ; Wed, 6 Nov 2013 01:02:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AC713205AD for ; Wed, 6 Nov 2013 01:02:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755668Ab3KFBCa (ORCPT ); Tue, 5 Nov 2013 20:02:30 -0500 Received: from mga09.intel.com ([134.134.136.24]:23980 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755605Ab3KFBCa (ORCPT ); Tue, 5 Nov 2013 20:02:30 -0500 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 05 Nov 2013 16:59:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.93,535,1378882800"; d="scan'208";a="404211982" Received: from aaronlu.sh.intel.com ([10.239.37.146]) by orsmga001.jf.intel.com with ESMTP; 05 Nov 2013 17:02:29 -0800 Message-ID: <52799553.7020406@intel.com> Date: Wed, 06 Nov 2013 09:03:15 +0800 From: Aaron Lu Organization: Intel, Shanghai, PRC MIME-Version: 1.0 To: "Rafael J. Wysocki" CC: Danny Baumann , ACPI Devel Mailing List Subject: [PATCH 1/2] ACPI / video: Fix initial level validity test Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When testing if the firmware's initial value is valid, we should use the corrected level value instead of the raw value returned from firmware. Signed-off-by: Aaron Lu Cc: Danny Baumann Cc: stable --- drivers/acpi/video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 38c3a28d6392..bf521b36c2f9 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c @@ -856,7 +856,7 @@ acpi_video_init_brightness(struct acpi_video_device *device) * or an index). Set the backlight to max_level in this case. */ for (i = 2; i < br->count; i++) - if (level_old == br->levels[i]) + if (level == br->levels[i]) break; if (i == br->count) level = max_level;