Skip to content

Commit

Permalink
spi: core: Convert to dev_pm_domain_attach|detach()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ulf Hansson authored and Rafael J. Wysocki committed Sep 22, 2014
1 parent 397a025 commit 676e7c2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions drivers/spi/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 676e7c2

Please sign in to comment.