* [PATCH v5 08/11] spi: core: Convert to dev_pm_domain_attach|detach()
[not found] <1411151264-16245-1-git-send-email-ulf.hansson@linaro.org>
@ 2014-09-19 18:27 ` Ulf Hansson
0 siblings, 0 replies; only message in thread
From: Ulf Hansson @ 2014-09-19 18:27 UTC (permalink / raw)
To: Rafael J. Wysocki, Len Brown, Pavel Machek, Greg Kroah-Hartman,
linux-pm
Cc: linux-arm-kernel, linux-acpi, Geert Uytterhoeven, Kevin Hilman,
Alan Stern, Daniel Lezcano, Tomasz Figa, devicetree,
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, linux-spi
Previously only the ACPI PM domain was supported by the spi bus.
Let's convert to the common attach/detach functions for PM domains,
which currently means we are extending the support to include the
generic PM domain as well.
Cc: linux-spi@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
---
drivers/spi/spi.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index ca935df..72a0beb 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -264,10 +264,12 @@ static int spi_drv_probe(struct device *dev)
if (ret)
return ret;
- acpi_dev_pm_attach(dev, true);
- ret = sdrv->probe(to_spi_device(dev));
- if (ret)
- acpi_dev_pm_detach(dev, true);
+ ret = dev_pm_domain_attach(dev, true);
+ if (ret != -EPROBE_DEFER) {
+ ret = sdrv->probe(to_spi_device(dev));
+ if (ret)
+ dev_pm_domain_detach(dev, true);
+ }
return ret;
}
@@ -278,7 +280,7 @@ static int spi_drv_remove(struct device *dev)
int ret;
ret = sdrv->remove(to_spi_device(dev));
- acpi_dev_pm_detach(dev, true);
+ dev_pm_domain_detach(dev, true);
return ret;
}
--
1.9.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-09-19 18:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1411151264-16245-1-git-send-email-ulf.hansson@linaro.org>
2014-09-19 18:27 ` [PATCH v5 08/11] spi: core: Convert to dev_pm_domain_attach|detach() Ulf Hansson
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).