From: Andrew Goodbody Date: Tue, 21 Oct 2025 16:08:27 +0000 (+0100) Subject: clk: microchip: mpfs: Fix error detection X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae4f60801f344aa26e3f2d1ffe6f6227be6f16a2;p=thirdparty%2Fu-boot.git 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 Acked-by: Conor Dooley --- diff --git a/drivers/clk/microchip/mpfs_clk_cfg.c b/drivers/clk/microchip/mpfs_clk_cfg.c index 7da1fc77120..b64fb6b7193 100644 --- a/drivers/clk/microchip/mpfs_clk_cfg.c +++ b/drivers/clk/microchip/mpfs_clk_cfg.c @@ -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); } diff --git a/drivers/clk/microchip/mpfs_clk_msspll.c b/drivers/clk/microchip/mpfs_clk_msspll.c index d0e7b1ff844..02b4a344467 100644 --- a/drivers/clk/microchip/mpfs_clk_msspll.c +++ b/drivers/clk/microchip/mpfs_clk_msspll.c @@ -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); diff --git a/drivers/clk/microchip/mpfs_clk_periph.c b/drivers/clk/microchip/mpfs_clk_periph.c index b734f49d81a..706d6841ee4 100644 --- a/drivers/clk/microchip/mpfs_clk_periph.c +++ b/drivers/clk/microchip/mpfs_clk_periph.c @@ -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); }