[PATCH 1/3] drm/bridge: ti-sn65dsi86: Simplify using pm_runtime_resume_and_get()

Neil Armstrong neil.armstrong at linaro.org
Fri Nov 24 08:48:59 UTC 2023


On 23/11/2023 18:54, Uwe Kleine-König wrote:
> 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 at pengutronix.de>
> ---
>   drivers/gpu/drm/bridge/ti-sn65dsi86.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> index c45c07840f64..5b8e1dfc458d 100644
> --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> @@ -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) {

Reviewed-by: Neil Armstrong <neil.armstrong at linaro.org>


More information about the dri-devel mailing list