From patchwork Wed Apr 5 06:49:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBLxJlwaWXFhA==?= X-Patchwork-Id: 9663087 X-Patchwork-Delegate: dvhart@infradead.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 70E8160353 for ; Wed, 5 Apr 2017 06:53:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6199B281B7 for ; Wed, 5 Apr 2017 06:53:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 564F928507; Wed, 5 Apr 2017 06:53:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0CB86281B7 for ; Wed, 5 Apr 2017 06:53:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753674AbdDEGxO (ORCPT ); Wed, 5 Apr 2017 02:53:14 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:34897 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753746AbdDEGtQ (ORCPT ); Wed, 5 Apr 2017 02:49:16 -0400 Received: by mail-lf0-f65.google.com with SMTP id v2so355187lfi.2 for ; Tue, 04 Apr 2017 23:49:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kempniu.pl; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bUecOil0KEYv29A10Fz3ScizxvYWZFecjMECciPGX6I=; b=WYzQSs5yZGJSMS7dRTt9Uj6j0f6PPPSSSiYo9+PBAHzRxVa56NvN5fj2QCS6gyUKXN sBnNTjRQFfFNFUtH3p7f5SvZvUmZibdzFSmU7OLu/BYa7267zo7pxfRZuCMCUz7tCR/o pkeSYR1TrGxOBmQQgio2pTzIo1dKvU2JNtkb0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bUecOil0KEYv29A10Fz3ScizxvYWZFecjMECciPGX6I=; b=qqeGBLKuMGZv8FqW8G5m7fnyUaylcTwygMkqdrg10XsMfyqM7oM4vsh6j8vgGiUy54 zhZJZ28Gd9zjFx6Fev7mng5FvPiDO3Vx0dqJup5XlzMVG6znQ/EwXy6kJh+KcWQN6lHY E4OBFF4X5TiVpDV9osM1TBE2f5KglDkJCPGsdocaxEhBGKGDY3ou2zvZorKOnvJrhgGH v4OPU+mEYmAvMy/LBrYUxhxnAWM37L9S51NJZDtEEh3pA4rRjRrxGf6CR8EHuEQGIu7d l5vYi9sGI4vqlYEyjsX3+DoLsb6MxNFgQv/cdMIv29XpDT1gPRf6zJQxUh+2XfsXUqie k6XA== X-Gm-Message-State: AFeK/H3Bhea4O+Sc0zBIAVol4DmR/GRtV9Ie0vBGeQU6Vz176fC9GcJLh8eVULaZXpTfnA== X-Received: by 10.46.20.87 with SMTP id 23mr7574044lju.54.1491374954332; Tue, 04 Apr 2017 23:49:14 -0700 (PDT) Received: from ozzy.nask.waw.pl ([2001:a10:160:3::3]) by smtp.googlemail.com with ESMTPSA id o91sm3619921lfg.1.2017.04.04.23.49.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Apr 2017 23:49:13 -0700 (PDT) From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= To: Jonathan Woithe , Darren Hart , Andy Shevchenko Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 01/11] platform/x86: fujitsu-laptop: only handle backlight when appropriate Date: Wed, 5 Apr 2017 08:49:00 +0200 Message-Id: <20170405064910.3162-2-kernel@kempniu.pl> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170405064910.3162-1-kernel@kempniu.pl> References: <20170405064910.3162-1-kernel@kempniu.pl> MIME-Version: 1.0 Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The backlight part of fujitsu-laptop is only used by laptops which are incapable of using the standard ACPI video interface for handling brightness changes. Conversely, on laptops which are capable of using the latter, no vendor-specific ACPI calls should be made unless explicitly requested by the user. Bail out immediately from acpi_fujitsu_bl_add() unless using the vendor-specific interface was either explicitly requested by the user or automatically selected by the kernel. Signed-off-by: Michał Kępień --- drivers/platform/x86/fujitsu-laptop.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c index f66da4b0c31a..722250d1aa20 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c @@ -589,6 +589,9 @@ static int acpi_fujitsu_bl_add(struct acpi_device *device) int state = 0; int error; + if (acpi_video_get_backlight_type() != acpi_backlight_vendor) + return -ENODEV; + if (!device) return -EINVAL; @@ -641,11 +644,9 @@ static int acpi_fujitsu_bl_add(struct acpi_device *device) fujitsu_bl->max_brightness = FUJITSU_LCD_N_LEVELS; get_lcd_level(); - if (acpi_video_get_backlight_type() == acpi_backlight_vendor) { - error = fujitsu_backlight_register(); - if (error) - return error; - } + error = fujitsu_backlight_register(); + if (error) + return error; return 0; }