clk: microchip: mpfs: Fix error detection

clk_register() will return standard error codes so the use of ERR_PTR()
is incorrect. Furthermore the code was ineffective as it lacked a return
statement that would have actually made use of the result. Add the
return statement and remove the use of ERR_PTR to correct this.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
This commit is contained in:
Andrew Goodbody
2025-10-21 17:08:27 +01:00
committed by Tom Rini
parent 42d30f9447
commit ae4f60801f
3 changed files with 3 additions and 3 deletions

View File

@@ -131,7 +131,7 @@ int mpfs_clk_register_cfgs(struct clk *parent, struct regmap *regmap)
name = mpfs_cfg_clks[i].cfg.name;
ret = clk_register(hw, MPFS_CFG_CLOCK, name, parent->dev->name);
if (ret)
ERR_PTR(ret);
return ret;
id = mpfs_cfg_clks[i].cfg.id;
clk_dm(id, hw);
}

View File

@@ -99,7 +99,7 @@ int mpfs_clk_register_msspll(void __iomem *base, struct clk *parent)
name = mpfs_msspll_clks[0].name;
ret = clk_register(hw, MPFS_MSSPLL_CLOCK, name, parent->dev->name);
if (ret)
ERR_PTR(ret);
return ret;
id = mpfs_msspll_clks[0].id;
clk_dm(id, hw);

View File

@@ -176,7 +176,7 @@ int mpfs_clk_register_periphs(struct udevice *dev, struct regmap *regmap)
name = mpfs_periph_clks[i].periph.name;
ret = clk_register(hw, MPFS_PERIPH_CLOCK, name, parent.dev->name);
if (ret)
ERR_PTR(ret);
return ret;
id = mpfs_periph_clks[i].periph.id;
clk_dm(id, hw);
}