diff mbox series

[01/10] drm/tidss: Use pm_runtime_resume_and_get()

Message ID 20231101-tidss-probe-v1-1-45149e0f9415@ideasonboard.com (mailing list archive)
State New, archived
Headers show
Series drm/tidss: Probe related fixes and cleanups | expand

Commit Message

Tomi Valkeinen Nov. 1, 2023, 9:17 a.m. UTC
Use pm_runtime_resume_and_get() instead of pm_runtime_get_sync(), which
will handle error situations better. Also fix the return, as there
should be no reason for the current complex return.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
 drivers/gpu/drm/tidss/tidss_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Laurent Pinchart Nov. 1, 2023, 1:47 p.m. UTC | #1
Hi Tomi,

Thank you for the patch.

On Wed, Nov 01, 2023 at 11:17:38AM +0200, Tomi Valkeinen wrote:
> Use pm_runtime_resume_and_get() instead of pm_runtime_get_sync(), which
> will handle error situations better. Also fix the return, as there
> should be no reason for the current complex return.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

But I think we would be better off dropping the two small wrappers.

> ---
>  drivers/gpu/drm/tidss/tidss_drv.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tidss/tidss_drv.c b/drivers/gpu/drm/tidss/tidss_drv.c
> index 4d063eb9cd0b..f403db11b846 100644
> --- a/drivers/gpu/drm/tidss/tidss_drv.c
> +++ b/drivers/gpu/drm/tidss/tidss_drv.c
> @@ -32,9 +32,9 @@ int tidss_runtime_get(struct tidss_device *tidss)
>  
>  	dev_dbg(tidss->dev, "%s\n", __func__);
>  
> -	r = pm_runtime_get_sync(tidss->dev);
> +	r = pm_runtime_resume_and_get(tidss->dev);
>  	WARN_ON(r < 0);
> -	return r < 0 ? r : 0;
> +	return r;
>  }
>  
>  void tidss_runtime_put(struct tidss_device *tidss)
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/tidss/tidss_drv.c b/drivers/gpu/drm/tidss/tidss_drv.c
index 4d063eb9cd0b..f403db11b846 100644
--- a/drivers/gpu/drm/tidss/tidss_drv.c
+++ b/drivers/gpu/drm/tidss/tidss_drv.c
@@ -32,9 +32,9 @@  int tidss_runtime_get(struct tidss_device *tidss)
 
 	dev_dbg(tidss->dev, "%s\n", __func__);
 
-	r = pm_runtime_get_sync(tidss->dev);
+	r = pm_runtime_resume_and_get(tidss->dev);
 	WARN_ON(r < 0);
-	return r < 0 ? r : 0;
+	return r;
 }
 
 void tidss_runtime_put(struct tidss_device *tidss)