drm/bridge: ti-sn65dsi86: Simplify using pm_runtime_resume_and_get()
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 23 Nov 2023 17:54:27 +0000 (18:54 +0100)
committerDouglas Anderson <dianders@chromium.org>
Wed, 29 Nov 2023 00:50:01 +0000 (16:50 -0800)
pm_runtime_resume_and_get() already drops the runtime PM usage counter
in the error case. So a call to pm_runtime_put_sync() can be dropped.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20231123175425.496956-2-u.kleine-koenig@pengutronix.de
drivers/gpu/drm/bridge/ti-sn65dsi86.c

index c45c07840f645a3216e0f0a8986920f1bd17d997..5b8e1dfc458da996ef1bf4bba92c054f5a991901 100644 (file)
@@ -1413,11 +1413,9 @@ static int ti_sn_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
        int ret;
 
        if (!pdata->pwm_enabled) {
-               ret = pm_runtime_get_sync(pdata->dev);
-               if (ret < 0) {
-                       pm_runtime_put_sync(pdata->dev);
+               ret = pm_runtime_resume_and_get(pdata->dev);
+               if (ret < 0)
                        return ret;
-               }
        }
 
        if (state->enabled) {