Commit dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with 
usage counter")
added pm_runtime_resume_and_get() in order to automatically handle
dev->power.usage_count decrement on errors.

Use the new API, in order to cleanup the error check logic.

Signed-off-by: Mauro Carvalho Chehab <mchehab+hua...@kernel.org>
---
 drivers/staging/media/hantro/hantro_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/hantro/hantro_drv.c 
b/drivers/staging/media/hantro/hantro_drv.c
index 595e82a82728..3147dcbebeb9 100644
--- a/drivers/staging/media/hantro/hantro_drv.c
+++ b/drivers/staging/media/hantro/hantro_drv.c
@@ -155,7 +155,7 @@ static void device_run(void *priv)
        ret = clk_bulk_enable(ctx->dev->variant->num_clocks, ctx->dev->clocks);
        if (ret)
                goto err_cancel_job;
-       ret = pm_runtime_get_sync(ctx->dev->dev);
+       ret = pm_runtime_resume_and_get(ctx->dev->dev);
        if (ret < 0)
                goto err_cancel_job;
 
-- 
2.30.2

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to