diff options
| author | Mark Brown <broonie@kernel.org> | 2026-04-22 13:49:21 +0100 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-04-22 13:49:21 +0100 |
| commit | 8370f1bd64d12a01a6c19e91d1dbe9bfbdb614f0 (patch) | |
| tree | c6bec3760a53565fd19cf8ac1f30a9112285c477 | |
| parent | a1d50a37d3b1df84f536a982f692371039df4a48 (diff) | |
| parent | fa5061daffe841c2577c987c4f3515c45e53b775 (diff) | |
spi: orion: runtime PM fixes
Johan Hovold <johan@kernel.org> says:
This series fixes some runtime PM related issues in the orion driver.
Included is also a related clean up.
| -rw-r--r-- | drivers/spi/spi-orion.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c index c54cd4ef09bdb..64bf215c18047 100644 --- a/drivers/spi/spi-orion.c +++ b/drivers/spi/spi-orion.c @@ -648,8 +648,8 @@ static int orion_spi_probe(struct platform_device *pdev) struct orion_spi *spi; struct resource *r; unsigned long tclk_hz; - int status = 0; struct device_node *np; + int status; host = spi_alloc_host(&pdev->dev, sizeof(*spi)); if (host == NULL) { @@ -774,6 +774,7 @@ static int orion_spi_probe(struct platform_device *pdev) pm_runtime_set_active(&pdev->dev); pm_runtime_use_autosuspend(&pdev->dev); pm_runtime_set_autosuspend_delay(&pdev->dev, SPI_AUTOSUSPEND_TIMEOUT); + pm_runtime_get_noresume(&pdev->dev); pm_runtime_enable(&pdev->dev); status = orion_spi_reset(spi); @@ -784,10 +785,15 @@ static int orion_spi_probe(struct platform_device *pdev) if (status < 0) goto out_rel_pm; - return status; + pm_runtime_put_autosuspend(&pdev->dev); + + return 0; out_rel_pm: pm_runtime_disable(&pdev->dev); + pm_runtime_put_noidle(&pdev->dev); + pm_runtime_set_suspended(&pdev->dev); + pm_runtime_dont_use_autosuspend(&pdev->dev); out_rel_axi_clk: clk_disable_unprepare(spi->axi_clk); out: @@ -811,6 +817,9 @@ static void orion_spi_remove(struct platform_device *pdev) spi_controller_put(host); pm_runtime_disable(&pdev->dev); + pm_runtime_put_noidle(&pdev->dev); + pm_runtime_set_suspended(&pdev->dev); + pm_runtime_dont_use_autosuspend(&pdev->dev); } MODULE_ALIAS("platform:" DRIVER_NAME); |
