From: Minghao Chi Date: Mon, 18 Apr 2022 10:55:08 +0000 (+0000) Subject: hwspinlock: using pm_runtime_resume_and_get instead of pm_runtime_get_sync X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0e01d176d5788f66dc64a7e61119edb56eb08339;p=linux.git 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 Signed-off-by: Minghao Chi Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220418105508.2558696-1-chi.minghao@zte.com.cn --- diff --git a/drivers/hwspinlock/omap_hwspinlock.c b/drivers/hwspinlock/omap_hwspinlock.c index 33eeff94fc2ab..1fb3a2550e292 100644 --- a/drivers/hwspinlock/omap_hwspinlock.c +++ b/drivers/hwspinlock/omap_hwspinlock.c @@ -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);