From patchwork Thu Mar 30 10:34:59 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: 9653727 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 13D826034C for ; Thu, 30 Mar 2017 10:38:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F398E2857F for ; Thu, 30 Mar 2017 10:38:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E86EA28582; Thu, 30 Mar 2017 10:38:46 +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=unavailable 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 AB86C2857F for ; Thu, 30 Mar 2017 10:38:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932667AbdC3Kid (ORCPT ); Thu, 30 Mar 2017 06:38:33 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:34803 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933646AbdC3KfV (ORCPT ); Thu, 30 Mar 2017 06:35:21 -0400 Received: by mail-lf0-f65.google.com with SMTP id x137so4173205lff.1 for ; Thu, 30 Mar 2017 03:35:20 -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=330eLeBbMW0kUpYYz39l382Hu0hkNl7HWmQOJQskIWw=; b=b5byd/+sjBgYtgf4EExfS8Ohvh9YwlDnxl2cMpfla6VXPu09eaUDocbeoRcyItQPLF b6i9lAUWmcoVydmi0RmqzzZXeQGen+rY8FuY8QG7nT/yvMhsqAC82OF4rhPhJGOb/oZz FJ8+Nc2/2UIZV0Qd1XeyDjxpu1jrxgtLPfQRs= 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=330eLeBbMW0kUpYYz39l382Hu0hkNl7HWmQOJQskIWw=; b=is3zZb+3l3pHd4Ws/7Ei4YIC5dT1rfHH6tRTrGawlW3NsRG7yatL8OMGPW2qhluJwj xRzBXFHZXYqnfgP7ShOYQ+w+QSk4oLjBEYYN8gqFi5PVZitlquhn3LneXJMsxgeLOQxU C7aKqTD4Ijy5IlnBBYfTEkE7qAdOvCeQK/15ssYNziOcHRk+z9mO02bDldoW5JVOj24Q HEvJZB1hO2Nh8vf1j7vNOHi8VKBcnE6D8MzFwM9aXX22l1phwFG0cdacI2HJ76GM0DqM yaZuqmA6nYBY2z/o8uQfphBPj/9nrg8mjS5sOw3And13Alg0KJSZqm7U8H1IOeh9qGDu 3miw== X-Gm-Message-State: AFeK/H3dSoVwSPC9jnOjsor33CbB+W5JnDrv3KzV0n+xV3G2B0u6gxS/HkJaysefIKAu2A== X-Received: by 10.25.141.73 with SMTP id p70mr1716946lfd.147.1490870114351; Thu, 30 Mar 2017 03:35:14 -0700 (PDT) Received: from ozzy.nask.waw.pl ([2001:a10:160:3::3]) by smtp.googlemail.com with ESMTPSA id x1sm296975lfb.54.2017.03.30.03.35.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Mar 2017 03:35: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 01/11] platform/x86: fujitsu-laptop: only handle backlight when appropriate Date: Thu, 30 Mar 2017 12:34:59 +0200 Message-Id: <20170330103509.32509-2-kernel@kempniu.pl> X-Mailer: git-send-email 2.12.1 In-Reply-To: <20170330103509.32509-1-kernel@kempniu.pl> References: <20170330103509.32509-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 52d6d2105f99..a428da3b591d 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; }