clk: imx: imx8: Add a message in case of devm_clk_hw_register_mux_parent_data_table...
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Thu, 14 Sep 2023 20:31:05 +0000 (22:31 +0200)
committerAbel Vesa <abel.vesa@linaro.org>
Wed, 4 Oct 2023 08:13:59 +0000 (11:13 +0300)
If devm_clk_hw_register_mux_parent_data_table() fails, we branch to the
error handling path and imx_check_clk_hws() is never called.

Actually, imx_check_clk_hws() is a no-op because values in 'hws' are either
valid, either NULL.

Move the call to imx_check_clk_hws() in the error handling path, so that
an error is logged.

Fixes: d3a0946d7ac9 ("clk: imx: imx8: add audio clock mux driver")
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
drivers/clk/imx/clk-imx8-acm.c

index 1c95ae905eec824598d4632dffd0faf6feebb12f..c744fb78bb446b4d968638c5b98472cff572fd55 100644 (file)
@@ -374,12 +374,11 @@ static int imx8_acm_clk_probe(struct platform_device *pdev)
                                                                                0, NULL, NULL);
                if (IS_ERR(hws[sels[i].clkid])) {
                        ret = PTR_ERR(hws[sels[i].clkid]);
+                       imx_check_clk_hws(hws, IMX_ADMA_ACM_CLK_END);
                        goto err_clk_register;
                }
        }
 
-       imx_check_clk_hws(hws, IMX_ADMA_ACM_CLK_END);
-
        ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, clk_hw_data);
        if (ret < 0) {
                dev_err(dev, "failed to register hws for ACM\n");