diff mbox series

[1/1] fbdev: mmp: fix value check in mmphw_probe()

Message ID 20230727170318.18412-1-ruc_gongyuanjun@163.com
State New
Headers show
Series [1/1] fbdev: mmp: fix value check in mmphw_probe() | expand

Commit Message

Yuanjun Gong July 27, 2023, 5:03 p.m. UTC
in mmphw_probe(), check the return value of clk_prepare_enable()
and return the error code if clk_prepare_enable() returns an
unexpected value.

Fixes: d63028c38905 ("video: mmp display controller support")
Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com>
---
 drivers/video/fbdev/mmp/hw/mmp_ctrl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Helge Deller July 31, 2023, 12:43 p.m. UTC | #1
On 7/27/23 19:03, Yuanjun Gong wrote:
> in mmphw_probe(), check the return value of clk_prepare_enable()
> and return the error code if clk_prepare_enable() returns an
> unexpected value.
>
> Fixes: d63028c38905 ("video: mmp display controller support")
> Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com>

applied.
Thanks!
Helge

> ---
>   drivers/video/fbdev/mmp/hw/mmp_ctrl.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/video/fbdev/mmp/hw/mmp_ctrl.c b/drivers/video/fbdev/mmp/hw/mmp_ctrl.c
> index 51fbf02a0343..76b50b6c98ad 100644
> --- a/drivers/video/fbdev/mmp/hw/mmp_ctrl.c
> +++ b/drivers/video/fbdev/mmp/hw/mmp_ctrl.c
> @@ -519,7 +519,9 @@ static int mmphw_probe(struct platform_device *pdev)
>   			      "unable to get clk %s\n", mi->clk_name);
>   		goto failed;
>   	}
> -	clk_prepare_enable(ctrl->clk);
> +	ret = clk_prepare_enable(ctrl->clk);
> +	if (ret)
> +		goto failed;
>
>   	/* init global regs */
>   	ctrl_set_default(ctrl);
diff mbox series

Patch

diff --git a/drivers/video/fbdev/mmp/hw/mmp_ctrl.c b/drivers/video/fbdev/mmp/hw/mmp_ctrl.c
index 51fbf02a0343..76b50b6c98ad 100644
--- a/drivers/video/fbdev/mmp/hw/mmp_ctrl.c
+++ b/drivers/video/fbdev/mmp/hw/mmp_ctrl.c
@@ -519,7 +519,9 @@  static int mmphw_probe(struct platform_device *pdev)
 			      "unable to get clk %s\n", mi->clk_name);
 		goto failed;
 	}
-	clk_prepare_enable(ctrl->clk);
+	ret = clk_prepare_enable(ctrl->clk);
+	if (ret)
+		goto failed;
 
 	/* init global regs */
 	ctrl_set_default(ctrl);