mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-04 18:09:57 +00:00
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 <lkundrak@v3.sk> Link: https://lore.kernel.org/r/20190719122713.3444318-1-lkundrak@v3.sk Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
2922d1cc16
commit
1274204542
1 changed files with 4 additions and 2 deletions
|
@ -1831,14 +1831,16 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
|
||||||
status = devm_spi_register_controller(&pdev->dev, controller);
|
status = devm_spi_register_controller(&pdev->dev, controller);
|
||||||
if (status != 0) {
|
if (status != 0) {
|
||||||
dev_err(&pdev->dev, "problem registering spi controller\n");
|
dev_err(&pdev->dev, "problem registering spi controller\n");
|
||||||
goto out_error_clock_enabled;
|
goto out_error_pm_runtime_enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
out_error_clock_enabled:
|
out_error_pm_runtime_enabled:
|
||||||
pm_runtime_put_noidle(&pdev->dev);
|
pm_runtime_put_noidle(&pdev->dev);
|
||||||
pm_runtime_disable(&pdev->dev);
|
pm_runtime_disable(&pdev->dev);
|
||||||
|
|
||||||
|
out_error_clock_enabled:
|
||||||
clk_disable_unprepare(ssp->clk);
|
clk_disable_unprepare(ssp->clk);
|
||||||
|
|
||||||
out_error_dma_irq_alloc:
|
out_error_dma_irq_alloc:
|
||||||
|
|
Loading…
Reference in a new issue