devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-pm@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Kevin Hilman <khilman@linaro.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Tomasz Figa <tomasz.figa@gmail.com>,
	devicetree@vger.kernel.org,
	Linus Walleij <linus.walleij@linaro.org>,
	Simon Horman <horms@verge.net.au>,
	Magnus Damm <magnus.damm@gmail.com>,
	Ben Dooks <ben-linux@fluff.org>,
	Kukjin Kim <kgene.kim@samsung.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Philipp Zabel <philipp.zabel@gmail.com>,
	Mark Brown <broonie@kernel.org>, Wolfram Sang <wsa@the-dreams.de>,
	Chris Ball <chris@printf.net>,
	Russell King <linux@arm.linux.org.uk>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Ulf Hansson <ulf.hansson@linaro.org>
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	[thread overview]
Message-ID: <1411151264-16245-12-git-send-email-ulf.hansson@linaro.org> (raw)
In-Reply-To: <1411151264-16245-1-git-send-email-ulf.hansson@linaro.org>

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 <ulf.hansson@linaro.org>
---
 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
-- 
1.9.1


  parent reply	other threads:[~2014-09-19 18:27 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-19 18:27 [PATCH v5 00/11] PM / Domains: Generic OF-based support Ulf Hansson
2014-09-19 18:27 ` [PATCH v5 01/11] PM / Domains: Add a detach callback to the struct dev_pm_domain Ulf Hansson
2014-09-22 11:15   ` Geert Uytterhoeven
2014-09-19 18:27 ` [PATCH v5 02/11] ACPI / PM: Assign the ->detach() callback when attaching the PM domain Ulf Hansson
2014-09-19 18:27 ` [PATCH v5 03/11] PM / Domains: Add generic OF-based PM domain look-up Ulf Hansson
2014-09-19 18:27 ` [PATCH v5 04/11] PM / Domains: Add APIs to attach/detach a PM domain for a device Ulf Hansson
2014-09-22 11:12   ` Geert Uytterhoeven
2014-09-19 18:27 ` [PATCH v5 05/11] drivercore / platform: Convert to dev_pm_domain_attach|detach() Ulf Hansson
2014-09-19 18:27 ` [PATCH v5 08/11] spi: core: " Ulf Hansson
2014-09-19 18:27 ` [PATCH v5 09/11] amba: Add support for attach/detach of PM domains Ulf Hansson
     [not found] ` <1411151264-16245-1-git-send-email-ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-09-19 18:27   ` [PATCH v5 06/11] i2c: core: Convert to dev_pm_domain_attach|detach() Ulf Hansson
     [not found]     ` <1411151264-16245-7-git-send-email-ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-09-20 12:23       ` Wolfram Sang
2014-09-20 23:48         ` Rafael J. Wysocki
2014-09-22  9:52         ` Mika Westerberg
2014-09-22 10:00           ` Wolfram Sang
2014-09-19 18:27   ` [PATCH v5 07/11] mmc: sdio: " Ulf Hansson
2014-10-02  0:27     ` Dmitry Torokhov
2014-10-13  2:48       ` Aaron Lu
2014-10-13 11:44         ` Ulf Hansson
2014-09-19 18:27   ` [PATCH v5 10/11] ARM: exynos: Move to generic PM domain DT bindings Ulf Hansson
2014-09-19 18:27 ` Ulf Hansson [this message]
2014-09-19 18:48 ` [PATCH v5 00/11] PM / Domains: Generic OF-based support Dmitry Torokhov
2014-09-22 14:19   ` Rafael J. Wysocki
2014-09-22 19:04     ` Ulf Hansson
2014-09-23  1:42     ` Mark Brown
2014-09-24 12:44     ` Grygorii Strashko
2014-09-24 13:51       ` Rafael J. Wysocki
2014-09-24 13:59         ` Grygorii Strashko
2014-09-25 11:21 ` Thierry Reding
2014-09-25 15:29   ` Ulf Hansson
2014-09-25 16:56     ` Thierry Reding
2014-09-26  0:27       ` Stephen Boyd
2014-09-26  5:08         ` Kevin Hilman
2014-09-26  7:44         ` Thierry Reding
2014-09-25 22:45   ` Kevin Hilman
2014-09-26  7:31     ` Thierry Reding
2014-09-26  8:06       ` Geert Uytterhoeven
2014-09-26  9:56         ` Thierry Reding
2014-09-26 10:01           ` Geert Uytterhoeven
2014-09-26 10:04             ` Thierry Reding
2014-09-26 14:50       ` Kevin Hilman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1411151264-16245-12-git-send-email-ulf.hansson@linaro.org \
    --to=ulf.hansson@linaro.org \
    --cc=ben-linux@fluff.org \
    --cc=broonie@kernel.org \
    --cc=chris@printf.net \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=gregkh@linuxfoundation.org \
    --cc=horms@verge.net.au \
    --cc=kgene.kim@samsung.com \
    --cc=khilman@linaro.org \
    --cc=len.brown@intel.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=magnus.damm@gmail.com \
    --cc=pavel@ucw.cz \
    --cc=philipp.zabel@gmail.com \
    --cc=rjw@rjwysocki.net \
    --cc=sboyd@codeaurora.org \
    --cc=stern@rowland.harvard.edu \
    --cc=tomasz.figa@gmail.com \
    --cc=wsa@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).