Skip to content

Commit 676e7c2

Browse files
Ulf Hanssonrafaeljw
authored andcommitted
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>
1 parent 397a025 commit 676e7c2

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

‎drivers/spi/spi.c‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,12 @@ static int spi_drv_probe(struct device *dev)
264264
if (ret)
265265
return ret;
266266

267-
acpi_dev_pm_attach(dev, true);
268-
ret = sdrv->probe(to_spi_device(dev));
269-
if (ret)
270-
acpi_dev_pm_detach(dev, true);
267+
ret = dev_pm_domain_attach(dev, true);
268+
if (ret != -EPROBE_DEFER) {
269+
ret = sdrv->probe(to_spi_device(dev));
270+
if (ret)
271+
dev_pm_domain_detach(dev, true);
272+
}
271273

272274
return ret;
273275
}
@@ -278,7 +280,7 @@ static int spi_drv_remove(struct device *dev)
278280
int ret;
279281

280282
ret = sdrv->remove(to_spi_device(dev));
281-
acpi_dev_pm_detach(dev, true);
283+
dev_pm_domain_detach(dev, true);
282284

283285
return ret;
284286
}

0 commit comments

Comments
 (0)