From patchwork Fri Sep 19 18:27:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 37656 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 71BCA20293 for ; Fri, 19 Sep 2014 18:28:39 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id gi9sf1863500lab.7 for ; Fri, 19 Sep 2014 11:28:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=jK4b6Mmg8b3D8Xbk0wdBQQa6Esq2O/6K++qBFGR2m4Q=; b=Eoi9oYQehhyzl+G8+068Qev6jz+5GcIcPgi/uIjJNi4m1WZBkYop/okod+McKxOjG5 U8ilmCZvbQrV6WWwNpzwkmzaLzzeUm/r1JlG9nIm13Tgw2PQwNj94Stjp50rJXVPxKD6 2obF1lSjBN6Kuuhdl6ZUWsR8smDIDS4mS1mfTbYaGMlI4+lTSWjjfDJ7LWyxtmcDhfd0 7/2xIv+11pztoZazc3sJbgSf6bJwehxOjBXdfVQZgbuXidKMTKJVKtLRLrao441cHFsM m8CuJMsaLi/lfS5Eik5U4JveF843Gu5Pv1VZacuDyixkE6RTQUYGGw2ZM0NomFLynNCU 5Y6g== X-Gm-Message-State: ALoCoQld9FpPU/LiFigzzrlIdcObbr7FmAfWX7hfsUpNNUr6oYEA3IovPOtT0z5i+blP/BSZeLSt X-Received: by 10.180.8.1 with SMTP id n1mr98990wia.1.1411151318240; Fri, 19 Sep 2014 11:28:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.203.235 with SMTP id kt11ls371298lac.83.gmail; Fri, 19 Sep 2014 11:28:38 -0700 (PDT) X-Received: by 10.112.34.143 with SMTP id z15mr8146171lbi.86.1411151317988; Fri, 19 Sep 2014 11:28:37 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com [209.85.215.52]) by mx.google.com with ESMTPS id zy4si3557148lbb.133.2014.09.19.11.28.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 19 Sep 2014 11:28:37 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by mail-la0-f52.google.com with SMTP id gq15so3701934lab.11 for ; Fri, 19 Sep 2014 11:28:37 -0700 (PDT) X-Received: by 10.152.22.137 with SMTP id d9mr8502597laf.29.1411151317911; Fri, 19 Sep 2014 11:28:37 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.130.169 with SMTP id of9csp989604lbb; Fri, 19 Sep 2014 11:28:37 -0700 (PDT) X-Received: by 10.66.141.39 with SMTP id rl7mr4287798pab.8.1411151307484; Fri, 19 Sep 2014 11:28:27 -0700 (PDT) Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) by mx.google.com with ESMTPS id q3si4199834pdp.139.2014.09.19.11.28.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 19 Sep 2014 11:28:27 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.192.174 as permitted sender) client-ip=209.85.192.174; Received: by mail-pd0-f174.google.com with SMTP id z10so425712pdj.5 for ; Fri, 19 Sep 2014 11:28:26 -0700 (PDT) X-Received: by 10.66.150.5 with SMTP id ue5mr3795037pab.129.1411151306728; Fri, 19 Sep 2014 11:28:26 -0700 (PDT) Received: from localhost.localdomain ([38.126.120.10]) by mx.google.com with ESMTPSA id ki1sm2495071pdb.59.2014.09.19.11.28.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 19 Sep 2014 11:28:26 -0700 (PDT) From: Ulf Hansson To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , Greg Kroah-Hartman , linux-pm@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, Geert Uytterhoeven , Kevin Hilman , Alan Stern , Daniel Lezcano , Tomasz Figa , devicetree@vger.kernel.org, Linus Walleij , Simon Horman , Magnus Damm , Ben Dooks , Kukjin Kim , Stephen Boyd , Philipp Zabel , Mark Brown , Wolfram Sang , Chris Ball , Russell King , Dmitry Torokhov , Ulf Hansson Subject: [PATCH v5 11/11] ACPI / PM: Convert acpi_dev_pm_detach() into a static function Date: Fri, 19 Sep 2014 20:27:44 +0200 Message-Id: <1411151264-16245-12-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1411151264-16245-1-git-send-email-ulf.hansson@linaro.org> References: <1411151264-16245-1-git-send-email-ulf.hansson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The ->detach() callback for the PM domain has now been fully adopted, thus there no users left of the acpi_dev_pm_detach() API. This allow us to convert it into a static function. Signed-off-by: Ulf Hansson --- drivers/acpi/device_pm.c | 69 ++++++++++++++++++++++++------------------------ include/linux/acpi.h | 2 -- 2 files changed, 34 insertions(+), 37 deletions(-) diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c index eec5ed5..bea6896 100644 --- a/drivers/acpi/device_pm.c +++ b/drivers/acpi/device_pm.c @@ -1041,6 +1041,40 @@ static struct dev_pm_domain acpi_general_pm_domain = { }; /** + * acpi_dev_pm_detach - Remove ACPI power management from the device. + * @dev: Device to take care of. + * @power_off: Whether or not to try to remove power from the device. + * + * Remove the device from the general ACPI PM domain and remove its wakeup + * notifier. If @power_off is set, additionally remove power from the device if + * possible. + * + * Callers must ensure proper synchronization of this function with power + * management callbacks. + */ +static void acpi_dev_pm_detach(struct device *dev, bool power_off) +{ + struct acpi_device *adev = ACPI_COMPANION(dev); + + if (adev && dev->pm_domain == &acpi_general_pm_domain) { + dev->pm_domain = NULL; + acpi_remove_pm_notifier(adev); + if (power_off) { + /* + * If the device's PM QoS resume latency limit or flags + * have been exposed to user space, they have to be + * hidden at this point, so that they don't affect the + * choice of the low-power state to put the device into. + */ + dev_pm_qos_hide_latency_limit(dev); + dev_pm_qos_hide_flags(dev); + acpi_device_wakeup(adev, ACPI_STATE_S0, false); + acpi_dev_pm_low_power(dev, adev, ACPI_STATE_S0); + } + } +} + +/** * acpi_dev_pm_attach - Prepare device for ACPI power management. * @dev: Device to prepare. * @power_on: Whether or not to power on the device. @@ -1077,39 +1111,4 @@ int acpi_dev_pm_attach(struct device *dev, bool power_on) return 0; } EXPORT_SYMBOL_GPL(acpi_dev_pm_attach); - -/** - * acpi_dev_pm_detach - Remove ACPI power management from the device. - * @dev: Device to take care of. - * @power_off: Whether or not to try to remove power from the device. - * - * Remove the device from the general ACPI PM domain and remove its wakeup - * notifier. If @power_off is set, additionally remove power from the device if - * possible. - * - * Callers must ensure proper synchronization of this function with power - * management callbacks. - */ -void acpi_dev_pm_detach(struct device *dev, bool power_off) -{ - struct acpi_device *adev = ACPI_COMPANION(dev); - - if (adev && dev->pm_domain == &acpi_general_pm_domain) { - dev->pm_domain = NULL; - acpi_remove_pm_notifier(adev); - if (power_off) { - /* - * If the device's PM QoS resume latency limit or flags - * have been exposed to user space, they have to be - * hidden at this point, so that they don't affect the - * choice of the low-power state to put the device into. - */ - dev_pm_qos_hide_latency_limit(dev); - dev_pm_qos_hide_flags(dev); - acpi_device_wakeup(adev, ACPI_STATE_S0, false); - acpi_dev_pm_low_power(dev, adev, ACPI_STATE_S0); - } - } -} -EXPORT_SYMBOL_GPL(acpi_dev_pm_detach); #endif /* CONFIG_PM */ diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 807cbc4..b7926bb 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -587,7 +587,6 @@ static inline int acpi_subsys_freeze(struct device *dev) { return 0; } #if defined(CONFIG_ACPI) && defined(CONFIG_PM) struct acpi_device *acpi_dev_pm_get_node(struct device *dev); int acpi_dev_pm_attach(struct device *dev, bool power_on); -void acpi_dev_pm_detach(struct device *dev, bool power_off); #else static inline struct acpi_device *acpi_dev_pm_get_node(struct device *dev) { @@ -597,7 +596,6 @@ static inline int acpi_dev_pm_attach(struct device *dev, bool power_on) { return -ENODEV; } -static inline void acpi_dev_pm_detach(struct device *dev, bool power_off) {} #endif #ifdef CONFIG_ACPI