hwspinlock: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
authorMinghao Chi <chi.minghao@zte.com.cn>
Mon, 18 Apr 2022 10:55:08 +0000 (10:55 +0000)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Fri, 22 Apr 2022 23:03:04 +0000 (18:03 -0500)
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
drivers/hwspinlock/omap_hwspinlock.c

index 33eeff94fc2abd3935c385977e1d77dde866d655..1fb3a2550e2929c46b9394fff5a1a42509249aa0 100644 (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);