From patchwork Fri Jun 16 04:40:56 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: 9790505 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 B979360326 for ; Fri, 16 Jun 2017 04:42:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B79F0285FE for ; Fri, 16 Jun 2017 04:42:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC47D28618; Fri, 16 Jun 2017 04:42:13 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI 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 505ED285FE for ; Fri, 16 Jun 2017 04:42:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752031AbdFPEl6 (ORCPT ); Fri, 16 Jun 2017 00:41:58 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:34296 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751955AbdFPElQ (ORCPT ); Fri, 16 Jun 2017 00:41:16 -0400 Received: by mail-wr0-f193.google.com with SMTP id y25so3107372wrd.1 for ; Thu, 15 Jun 2017 21:41: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=a5aLvQVCwSLKF3E7Wr/7PuNELL0n3S62x2KFN+uXiCE=; b=Hl47mqaSpYRSjvbuwoSRrNWvsfm+UYEP45r5S3Ui/8Nl5BHd2fxJDLCNWDCCzuytJa TkRWkMfXR3pXarvAc6rBuMbVQ6uVaOn5EQA1U50ySK4Jl9HHHwYRHgOTVb6YaQHcZTHU 1QUe/1pZZ7DpZebI+vaSA/nmyevGhZtk2rpog= 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=a5aLvQVCwSLKF3E7Wr/7PuNELL0n3S62x2KFN+uXiCE=; b=jNbsR7aF5gB7Oo0yjy5hde//sc5oJjofdrJzYT+FQYdjmurD3j5tc7csvACM93/Qvh +AqDy8EGlSMinuUvyTrRey8eWH6sF/4kms8ptiXEHgH7gYt9Z2m1rcsqAEmmHkEunqNK EkhUxbnIU91yNHkYDUxR97yCGHeyEZIGtsIvvds9W0TW3xQcmKuv/1QTY/x56iA5Ox6+ FcjR//Z1luhNEbyQZ3xbgMQ+WbN9OL24dcw6IUCrXpvZvtSFyylZA8JKQdOSqDnGdP7I SNM1Hb+9euPITTaD/oeEfMxGmMjwUR1JqUP1mPSpKvSSAFP4SpOWQsl4bFk3QISOROwz IybQ== X-Gm-Message-State: AKS2vOzLvq3lZQ4XISUS9oZnTtp7p3fECPZXouEafNJhZhZBDCVmhlID hx2IUZy5u8zM7yle X-Received: by 10.223.147.165 with SMTP id 34mr5348598wrp.175.1497588075075; Thu, 15 Jun 2017 21:41:15 -0700 (PDT) Received: from kmp-mobile.hq.kempniu.pl (kmp-mobile.hq.kempniu.pl. [2001:470:64df:111::2d90]) by smtp.googlemail.com with ESMTPSA id g3sm2026681wrd.11.2017.06.15.21.41.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Jun 2017 21:41:14 -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-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/7] platform/x86: fujitsu-laptop: do not update ACPI device power status Date: Fri, 16 Jun 2017 06:40:56 +0200 Message-Id: <20170616044058.30443-6-kernel@kempniu.pl> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170616044058.30443-1-kernel@kempniu.pl> References: <20170616044058.30443-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 Calling acpi_bus_update_power() for ACPI devices FUJ02B1 and FUJ02E3 is pointless as they are not power manageable (neither _PS0 nor _PR0 is defined for any of them), which causes their power state to be inherited from their parent devices. Given the ACPI paths of these two devices (\_SB.PCI0.LPCB.FJEX, \_SB.FEXT), their parent devices are also not power manageable. These parent devices will thus have their power state initialized to ACPI_STATE_D0, which in turn causes the power state for both FUJ02B1 and FUJ02E3 to always be ACPI_STATE_D0 ("on"). Remove relevant acpi_bus_update_power() calls along with parts of debug messages that they were supposed to have an effect on. Signed-off-by: Michał Kępień --- drivers/platform/x86/fujitsu-laptop.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c index 5c0dc2126313..b9f3ede4d567 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c @@ -400,7 +400,6 @@ static int fujitsu_backlight_register(struct acpi_device *device) static int acpi_fujitsu_bl_add(struct acpi_device *device) { struct fujitsu_bl *priv; - int state = 0; int error; if (acpi_video_get_backlight_type() != acpi_backlight_vendor) @@ -419,15 +418,8 @@ static int acpi_fujitsu_bl_add(struct acpi_device *device) if (error) return error; - error = acpi_bus_update_power(device->handle, &state); - if (error) { - pr_err("Error reading power state\n"); - return error; - } - - pr_info("ACPI: %s [%s] (%s)\n", - acpi_device_name(device), acpi_device_bid(device), - !device->power.state ? "on" : "off"); + pr_info("ACPI: %s [%s]\n", + acpi_device_name(device), acpi_device_bid(device)); if (acpi_has_method(device->handle, METHOD_NAME__INI)) { vdbg_printk(FUJLAPTOP_DBG_INFO, "Invoking _INI\n"); @@ -788,7 +780,6 @@ static int acpi_fujitsu_laptop_leds_register(struct acpi_device *device) static int acpi_fujitsu_laptop_add(struct acpi_device *device) { struct fujitsu_laptop *priv; - int state = 0; int error; int i; @@ -807,15 +798,8 @@ static int acpi_fujitsu_laptop_add(struct acpi_device *device) if (error) return error; - error = acpi_bus_update_power(device->handle, &state); - if (error) { - pr_err("Error reading power state\n"); - return error; - } - - pr_info("ACPI: %s [%s] (%s)\n", - acpi_device_name(device), acpi_device_bid(device), - !device->power.state ? "on" : "off"); + pr_info("ACPI: %s [%s]\n", + acpi_device_name(device), acpi_device_bid(device)); if (acpi_has_method(device->handle, METHOD_NAME__INI)) { vdbg_printk(FUJLAPTOP_DBG_INFO, "Invoking _INI\n");