[PATCH 1/3] drm/bridge: ti-sn65dsi86: Simplify using pm_runtime_resume_and_get()
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Wed Nov 29 00:39:55 UTC 2023
Hi Uwe,
Thank you for the patch.
On Thu, Nov 23, 2023 at 06:54:27PM +0100, 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>
I wonder if checkpatch should warn about usage of pm_runtime_get_sync().
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
> 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) {
--
Regards,
Laurent Pinchart
More information about the dri-devel
mailing list