[PATCH 3/6] clk: microchip: mpfs: Fix error detection
    Andrew Goodbody 
    andrew.goodbody at linaro.org
       
    Tue Oct 21 18:08:27 CEST 2025
    
    
  
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 at linaro.org>
---
 drivers/clk/microchip/mpfs_clk_cfg.c    | 2 +-
 drivers/clk/microchip/mpfs_clk_msspll.c | 2 +-
 drivers/clk/microchip/mpfs_clk_periph.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/clk/microchip/mpfs_clk_cfg.c b/drivers/clk/microchip/mpfs_clk_cfg.c
index 7da1fc77120b63d569ee0490a72e1616dd6e8f74..b64fb6b719317dca58169ca9d339332929143874 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 d0e7b1ff844f00c4fd97f9188a376d1837ef1d99..02b4a34446717532972e0d460765d6d1864d17fc 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 b734f49d81aa2f19d5b142d74de5bb8644d5e52b..706d6841ee493bdbf6a1d4568b0327bcd54e668b 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);
 	}
-- 
2.47.3
    
    
More information about the U-Boot
mailing list