diff mbox series

clk: mediatek: clk-mt8195-topckgen: Fix error return code in clk_mt8195_topck_probe()

Message ID 20221009025056.35311-1-yangyingliang@huawei.com (mailing list archive)
State New, archived
Headers show
Series clk: mediatek: clk-mt8195-topckgen: Fix error return code in clk_mt8195_topck_probe() | expand

Commit Message

Yang Yingliang Oct. 9, 2022, 2:50 a.m. UTC
If devm_clk_hw_register_mux() fails in clk_mt8195_topck_probe(), it should return
error code.

Fixes: deeb2af77cf6 ("clk: mediatek: clk-mt8195-topckgen: Register mfg_ck_fast_ref as generic mux")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/clk/mediatek/clk-mt8195-topckgen.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

AngeloGioacchino Del Regno Oct. 10, 2022, 8:08 a.m. UTC | #1
Il 09/10/22 04:50, Yang Yingliang ha scritto:
> If devm_clk_hw_register_mux() fails in clk_mt8195_topck_probe(), it should return
> error code.
> 
> Fixes: deeb2af77cf6 ("clk: mediatek: clk-mt8195-topckgen: Register mfg_ck_fast_ref as generic mux")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Stephen Boyd Oct. 17, 2022, 9:07 p.m. UTC | #2
Quoting Yang Yingliang (2022-10-08 19:50:56)
> If devm_clk_hw_register_mux() fails in clk_mt8195_topck_probe(), it should return
> error code.
> 
> Fixes: deeb2af77cf6 ("clk: mediatek: clk-mt8195-topckgen: Register mfg_ck_fast_ref as generic mux")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---

Applied to clk-fixes
diff mbox series

Patch

diff --git a/drivers/clk/mediatek/clk-mt8195-topckgen.c b/drivers/clk/mediatek/clk-mt8195-topckgen.c
index 8cbab5ca2e58..1e016329c1d2 100644
--- a/drivers/clk/mediatek/clk-mt8195-topckgen.c
+++ b/drivers/clk/mediatek/clk-mt8195-topckgen.c
@@ -1270,8 +1270,10 @@  static int clk_mt8195_topck_probe(struct platform_device *pdev)
 	hw = devm_clk_hw_register_mux(&pdev->dev, "mfg_ck_fast_ref", mfg_fast_parents,
 				      ARRAY_SIZE(mfg_fast_parents), CLK_SET_RATE_PARENT,
 				      (base + 0x250), 8, 1, 0, &mt8195_clk_lock);
-	if (IS_ERR(hw))
+	if (IS_ERR(hw)) {
+		r = PTR_ERR(hw);
 		goto unregister_muxes;
+	}
 	top_clk_data->hws[CLK_TOP_MFG_CK_FAST_REF] = hw;
 
 	r = clk_mt8195_reg_mfg_mux_notifier(&pdev->dev,