hwspinlock: using pm_runtime_resume_and_get instead of pm_runtime_get_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
This commit is contained in:
Minghao Chi 2022-04-18 10:55:08 +00:00 committed by Bjorn Andersson
parent ce522ba9ef
commit 0e01d176d5
1 changed files with 2 additions and 4 deletions

View File

@ -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);