diff mbox series

[2/2] clk: imx: imx8: Fix error code in probe

Message ID 06727485-a142-4ebb-b764-49841537d44b@moroto.mountain (mailing list archive)
State New, archived
Headers show
Series [1/2] clk: imx: imx8: Fix an IS_ERR() vs NULL check in clk_imx_acm_attach_pm_domains() | expand

Commit Message

Dan Carpenter Oct. 2, 2023, 7:03 a.m. UTC
Preserve the error code from devm_clk_hw_register_mux_parent_data_table()
instead of returning success.

Fixes: d3a0946d7ac9 ("clk: imx: imx8: add audio clock mux driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/clk/imx/clk-imx8-acm.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Peng Fan Oct. 3, 2023, 9:49 a.m. UTC | #1
> Subject: [PATCH 2/2] clk: imx: imx8: Fix error code in probe
> 
> Preserve the error code from devm_clk_hw_register_mux_parent_data_table()
> instead of returning success.
> 
> Fixes: d3a0946d7ac9 ("clk: imx: imx8: add audio clock mux driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Reviewed-by: Peng Fan <peng.fan@nxp.com>
> ---
>  drivers/clk/imx/clk-imx8-acm.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/clk/imx/clk-imx8-acm.c b/drivers/clk/imx/clk-imx8-acm.c
> index 83019b986622..550ceac45ff2 100644
> --- a/drivers/clk/imx/clk-imx8-acm.c
> +++ b/drivers/clk/imx/clk-imx8-acm.c
> @@ -372,6 +372,7 @@ static int imx8_acm_clk_probe(struct
> platform_device *pdev)
> 
> 	0, NULL, NULL);
>  		if (IS_ERR(hws[sels[i].clkid])) {
>  			pm_runtime_disable(&pdev->dev);
> +			ret = PTR_ERR(hws[sels[i].clkid]);
>  			goto err_clk_register;
>  		}
>  	}
> --
> 2.39.2
diff mbox series

Patch

diff --git a/drivers/clk/imx/clk-imx8-acm.c b/drivers/clk/imx/clk-imx8-acm.c
index 83019b986622..550ceac45ff2 100644
--- a/drivers/clk/imx/clk-imx8-acm.c
+++ b/drivers/clk/imx/clk-imx8-acm.c
@@ -372,6 +372,7 @@  static int imx8_acm_clk_probe(struct platform_device *pdev)
 										0, NULL, NULL);
 		if (IS_ERR(hws[sels[i].clkid])) {
 			pm_runtime_disable(&pdev->dev);
+			ret = PTR_ERR(hws[sels[i].clkid]);
 			goto err_clk_register;
 		}
 	}