diff mbox series

drm/meson: pm resume add return errno branch

Message ID 20200428131747.2099-1-bernard@vivo.com (mailing list archive)
State Mainlined
Commit c54a8f1f329197d83d941ad84c4aa38bf282cbbd
Headers show
Series drm/meson: pm resume add return errno branch | expand

Commit Message

Bernard Zhao April 28, 2020, 1:17 p.m. UTC
pm_resump api did not handle drm_mode_config_helper_resume error.
This change add handle to return drm_mode_config_helper_resume`s
error number. This code logic is aligned with api pm_suspend.
After this change, the code maybe a bit readable.

Signed-off-by: Bernard Zhao <bernard@vivo.com>
---
 drivers/gpu/drm/meson/meson_drv.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Bernard Zhao May 7, 2020, 3:09 a.m. UTC | #1
From: Bernard Zhao <bernard@vivo.com>
Date: 2020-04-28 21:17:47
To:  Neil Armstrong <narmstrong@baylibre.com>,David Airlie <airlied@linux.ie>,Daniel Vetter <daniel@ffwll.ch>,Kevin Hilman <khilman@baylibre.com>,dri-devel@lists.freedesktop.org,linux-amlogic@lists.infradead.org,linux-arm-kernel@lists.infradead.org,linux-kernel@vger.kernel.org
Cc:  opensource.kernel@vivo.com,Bernard Zhao <bernard@vivo.com>
Subject: [PATCH] drm/meson: pm resume add return errno branch>pm_resump api did not handle drm_mode_config_helper_resume error.
>This change add handle to return drm_mode_config_helper_resume`s
>error number. This code logic is aligned with api pm_suspend.
>After this change, the code maybe a bit readable.
>
>Signed-off-by: Bernard Zhao <bernard@vivo.com>
>---
> drivers/gpu/drm/meson/meson_drv.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
>diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c
>index b5f5eb7b4bb9..8c2e1b47e81a 100644
>--- a/drivers/gpu/drm/meson/meson_drv.c
>+++ b/drivers/gpu/drm/meson/meson_drv.c
>@@ -412,9 +412,7 @@ static int __maybe_unused meson_drv_pm_resume(struct device *dev)
> 	if (priv->afbcd.ops)
> 		priv->afbcd.ops->init(priv);
> 
>-	drm_mode_config_helper_resume(priv->drm);
>-
>-	return 0;
>+	return drm_mode_config_helper_resume(priv->drm);
> }
> 
> static int compare_of(struct device *dev, void *data)
>-- 
>2.26.2
>
Neil Armstrong May 13, 2020, 2:27 p.m. UTC | #2
On 28/04/2020 15:17, Bernard Zhao wrote:
> pm_resump api did not handle drm_mode_config_helper_resume error.
> This change add handle to return drm_mode_config_helper_resume`s
> error number. This code logic is aligned with api pm_suspend.
> After this change, the code maybe a bit readable.
> 
> Signed-off-by: Bernard Zhao <bernard@vivo.com>
> ---
>  drivers/gpu/drm/meson/meson_drv.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c
> index b5f5eb7b4bb9..8c2e1b47e81a 100644
> --- a/drivers/gpu/drm/meson/meson_drv.c
> +++ b/drivers/gpu/drm/meson/meson_drv.c
> @@ -412,9 +412,7 @@ static int __maybe_unused meson_drv_pm_resume(struct device *dev)
>  	if (priv->afbcd.ops)
>  		priv->afbcd.ops->init(priv);
>  
> -	drm_mode_config_helper_resume(priv->drm);
> -
> -	return 0;
> +	return drm_mode_config_helper_resume(priv->drm);
>  }
>  
>  static int compare_of(struct device *dev, void *data)
> 

Applied to drm-misc-fixes

Thanks,
Neil
diff mbox series

Patch

diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c
index b5f5eb7b4bb9..8c2e1b47e81a 100644
--- a/drivers/gpu/drm/meson/meson_drv.c
+++ b/drivers/gpu/drm/meson/meson_drv.c
@@ -412,9 +412,7 @@  static int __maybe_unused meson_drv_pm_resume(struct device *dev)
 	if (priv->afbcd.ops)
 		priv->afbcd.ops->init(priv);
 
-	drm_mode_config_helper_resume(priv->drm);
-
-	return 0;
+	return drm_mode_config_helper_resume(priv->drm);
 }
 
 static int compare_of(struct device *dev, void *data)