Skip to content

Commit

Permalink
hwspinlock: using pm_runtime_resume_and_get instead of pm_runtime_get…
Browse files Browse the repository at this point in the history
…_sync

Using pm_runtime_resume_and_get is more appropriate
for simplifing code

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20220418105508.2558696-1-chi.minghao@zte.com.cn
  • Loading branch information
Minghao Chi authored and andersson committed Apr 22, 2022
1 parent ce522ba commit 0e01d17
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/hwspinlock/omap_hwspinlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,9 @@ static int omap_hwspinlock_probe(struct platform_device *pdev)
* the module SYSSTATUS register
*/
pm_runtime_enable(&pdev->dev);
ret = pm_runtime_get_sync(&pdev->dev);
if (ret < 0) {
pm_runtime_put_noidle(&pdev->dev);
ret = pm_runtime_resume_and_get(&pdev->dev);
if (ret < 0)
goto runtime_err;
}

/* Determine number of locks */
i = readl(io_base + SYSSTATUS_OFFSET);
Expand Down

0 comments on commit 0e01d17

Please sign in to comment.