diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2014-09-19 14:27:41 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-09-22 09:57:40 -0400 |
commit | 676e7c257a339b44b8a613be145b22b85cf2ffc4 (patch) | |
tree | 16ed7cedadbe923d7311a26808c903b3ab3f3540 /drivers/spi/spi.c | |
parent | 397a0253527a578fa036d3438ad4909c65d63166 (diff) |
spi: core: Convert to dev_pm_domain_attach|detach()
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.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/spi/spi.c')
-rw-r--r-- | drivers/spi/spi.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index ca935df80c88..72a0beb1fafa 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c | |||
@@ -264,10 +264,12 @@ static int spi_drv_probe(struct device *dev) | |||
264 | if (ret) | 264 | if (ret) |
265 | return ret; | 265 | return ret; |
266 | 266 | ||
267 | acpi_dev_pm_attach(dev, true); | 267 | ret = dev_pm_domain_attach(dev, true); |
268 | ret = sdrv->probe(to_spi_device(dev)); | 268 | if (ret != -EPROBE_DEFER) { |
269 | if (ret) | 269 | ret = sdrv->probe(to_spi_device(dev)); |
270 | acpi_dev_pm_detach(dev, true); | 270 | if (ret) |
271 | dev_pm_domain_detach(dev, true); | ||
272 | } | ||
271 | 273 | ||
272 | return ret; | 274 | return ret; |
273 | } | 275 | } |
@@ -278,7 +280,7 @@ static int spi_drv_remove(struct device *dev) | |||
278 | int ret; | 280 | int ret; |
279 | 281 | ||
280 | ret = sdrv->remove(to_spi_device(dev)); | 282 | ret = sdrv->remove(to_spi_device(dev)); |
281 | acpi_dev_pm_detach(dev, true); | 283 | dev_pm_domain_detach(dev, true); |
282 | 284 | ||
283 | return ret; | 285 | return ret; |
284 | } | 286 | } |