[v7,19/23] drm/mediatek: Return error if MDP RDMA failed to enable the clock

Message ID 20231006073831.10402-20-shawn.sung@mediatek.com
State New
Headers
Series Add display driver for MT8188 VDOSYS1 |

Commit Message

Shawn Sung (宋孝謙) Oct. 6, 2023, 7:38 a.m. UTC
  Return the result of clk_prepare_enable() instead of
always returns 0.

Fixes: f8946e2b6bb2 ("drm/mediatek: Add display MDP RDMA support for MT8195")

Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.com>
---
 drivers/gpu/drm/mediatek/mtk_mdp_rdma.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
  

Comments

CK Hu (胡俊光) Oct. 6, 2023, 9:07 a.m. UTC | #1
Hi, Hsiao-chien:

On Fri, 2023-10-06 at 15:38 +0800, Hsiao Chien Sung wrote:
> Return the result of clk_prepare_enable() instead of
> always returns 0.

Reviewed-by: CK Hu <ck.hu@mediatek.com>

> 
> Fixes: f8946e2b6bb2 ("drm/mediatek: Add display MDP RDMA support for
> MT8195")
> 
> Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_mdp_rdma.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
> b/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
> index c3adaeefd551..c7233d0ac210 100644
> --- a/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
> +++ b/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
> @@ -246,8 +246,7 @@ int mtk_mdp_rdma_clk_enable(struct device *dev)
>  {
>  	struct mtk_mdp_rdma *rdma = dev_get_drvdata(dev);
>  
> -	clk_prepare_enable(rdma->clk);
> -	return 0;
> +	return clk_prepare_enable(rdma->clk);
>  }
>  
>  void mtk_mdp_rdma_clk_disable(struct device *dev)
  

Patch

diff --git a/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c b/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
index c3adaeefd551..c7233d0ac210 100644
--- a/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
+++ b/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
@@ -246,8 +246,7 @@  int mtk_mdp_rdma_clk_enable(struct device *dev)
 {
 	struct mtk_mdp_rdma *rdma = dev_get_drvdata(dev);
 
-	clk_prepare_enable(rdma->clk);
-	return 0;
+	return clk_prepare_enable(rdma->clk);
 }
 
 void mtk_mdp_rdma_clk_disable(struct device *dev)