linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ulf.hansson@linaro.org (Ulf Hansson)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 4/9] drivercore / platform: Convert to dev_pm_domain_attach|detach()
Date: Thu, 28 Aug 2014 10:38:57 +0200	[thread overview]
Message-ID: <1409215142-8218-5-git-send-email-ulf.hansson@linaro.org> (raw)
In-Reply-To: <1409215142-8218-1-git-send-email-ulf.hansson@linaro.org>

Previously only the ACPI power domain was supported by the platform
bus.

Let's convert to the common attach/detach functions for power domains,
which currently means we are extending the support to include the
generic power domain as well.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 drivers/base/platform.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index ab4f4ce..904be3d 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -506,11 +506,12 @@ static int platform_drv_probe(struct device *_dev)
 	if (ret < 0)
 		return ret;
 
-	acpi_dev_pm_attach(_dev, true);
-
-	ret = drv->probe(dev);
-	if (ret)
-		acpi_dev_pm_detach(_dev, true);
+	ret = dev_pm_domain_attach(_dev, true);
+	if (ret != -EPROBE_DEFER) {
+		ret = drv->probe(dev);
+		if (ret)
+			dev_pm_domain_detach(_dev, true);
+	}
 
 	if (drv->prevent_deferred_probe && ret == -EPROBE_DEFER) {
 		dev_warn(_dev, "probe deferral not supported\n");
@@ -532,7 +533,7 @@ static int platform_drv_remove(struct device *_dev)
 	int ret;
 
 	ret = drv->remove(dev);
-	acpi_dev_pm_detach(_dev, true);
+	dev_pm_domain_detach(_dev, true);
 
 	return ret;
 }
@@ -543,7 +544,7 @@ static void platform_drv_shutdown(struct device *_dev)
 	struct platform_device *dev = to_platform_device(_dev);
 
 	drv->shutdown(dev);
-	acpi_dev_pm_detach(_dev, true);
+	dev_pm_domain_detach(_dev, true);
 }
 
 /**
-- 
1.9.1

  parent reply	other threads:[~2014-08-28  8:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-28  8:38 [PATCH v2 0/9] PM / Domains: Generic OF-based support Ulf Hansson
2014-08-28  8:38 ` [PATCH v2 1/9] ACPI / PM: Let acpi_dev_pm_detach() return an error code Ulf Hansson
2014-08-28  8:38 ` [PATCH v2 2/9] PM / Domains: Add generic OF-based power domain look-up Ulf Hansson
2014-09-02 18:28   ` Geert Uytterhoeven
2014-09-03 11:24     ` Ulf Hansson
2014-08-28  8:38 ` [PATCH v2 3/9] PM / Domains: Add APIs to attach/detach a PM domain for a device Ulf Hansson
2014-08-28  8:38 ` Ulf Hansson [this message]
2014-08-28  8:38 ` [PATCH v2 5/9] i2c: core: Convert to dev_pm_domain_attach|detach() Ulf Hansson
2014-08-28  8:38 ` [PATCH v2 6/9] mmc: sdio: " Ulf Hansson
2014-08-28  8:39 ` [PATCH v2 7/9] spi: core: " Ulf Hansson
2014-08-28  8:39 ` [PATCH v2 8/9] amba: Add support for attach/detach of power domains Ulf Hansson
2014-08-28  8:39 ` [PATCH v2 9/9] ARM: exynos: Move to generic power domain bindings Ulf Hansson

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=1409215142-8218-5-git-send-email-ulf.hansson@linaro.org \
    --to=ulf.hansson@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).