Skip to content

Commit

Permalink
dmaengine: tegra210-adma: Using pm_runtime_resume_and_get to replace …
Browse files Browse the repository at this point in the history
…open coding

use pm_runtime_resume_and_get() to replace pm_runtime_get_sync and
pm_runtime_put_noidle. this change is just to simplify the code,
there is no actual functional change.

Signed-off-by: Zhang Qilong <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
  • Loading branch information
Zhang Qilong authored and vinodkoul committed Jul 28, 2021
1 parent 48ae638 commit 059e969
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/dma/tegra210-adma.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,9 +655,8 @@ static int tegra_adma_alloc_chan_resources(struct dma_chan *dc)
return ret;
}

ret = pm_runtime_get_sync(tdc2dev(tdc));
ret = pm_runtime_resume_and_get(tdc2dev(tdc));
if (ret < 0) {
pm_runtime_put_noidle(tdc2dev(tdc));
free_irq(tdc->irq, tdc);
return ret;
}
Expand Down Expand Up @@ -869,10 +868,8 @@ static int tegra_adma_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev);

ret = pm_runtime_get_sync(&pdev->dev);
if (ret < 0) {
pm_runtime_put_noidle(&pdev->dev);
if (ret < 0)
goto rpm_disable;
}

ret = tegra_adma_init(tdma);
if (ret)
Expand Down

0 comments on commit 059e969

Please sign in to comment.