Skip to content

Commit 1274204

Browse files
lkundrakbroonie
authored andcommitted
spi: pxa2xx: Balance runtime PM enable/disable on error
Don't undo the PM initialization if we error out before we managed to initialize it. The call to pm_runtime_disable() without being preceded by pm_runtime_enable() would disturb the balance of the Force. In practice, this happens if we fail to allocate any of the GPIOS ("cs", "ready") due to -EPROBE_DEFER because we're getting probled before the GPIO driver. Signed-off-by: Lubomir Rintel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 2922d1c commit 1274204

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/spi/spi-pxa2xx.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1831,14 +1831,16 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
18311831
status = devm_spi_register_controller(&pdev->dev, controller);
18321832
if (status != 0) {
18331833
dev_err(&pdev->dev, "problem registering spi controller\n");
1834-
goto out_error_clock_enabled;
1834+
goto out_error_pm_runtime_enabled;
18351835
}
18361836

18371837
return status;
18381838

1839-
out_error_clock_enabled:
1839+
out_error_pm_runtime_enabled:
18401840
pm_runtime_put_noidle(&pdev->dev);
18411841
pm_runtime_disable(&pdev->dev);
1842+
1843+
out_error_clock_enabled:
18421844
clk_disable_unprepare(ssp->clk);
18431845

18441846
out_error_dma_irq_alloc:

0 commit comments

Comments
 (0)