]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
clk: microchip: mpfs: Fix error detection
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Tue, 21 Oct 2025 16:08:27 +0000 (17:08 +0100)
committerTom Rini <trini@konsulko.com>
Thu, 4 Dec 2025 15:38:16 +0000 (09:38 -0600)
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>
drivers/clk/microchip/mpfs_clk_cfg.c
drivers/clk/microchip/mpfs_clk_msspll.c
drivers/clk/microchip/mpfs_clk_periph.c

index 7da1fc77120b63d569ee0490a72e1616dd6e8f74..b64fb6b719317dca58169ca9d339332929143874 100644 (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);
        }
index d0e7b1ff844f00c4fd97f9188a376d1837ef1d99..02b4a34446717532972e0d460765d6d1864d17fc 100644 (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);
 
index b734f49d81aa2f19d5b142d74de5bb8644d5e52b..706d6841ee493bdbf6a1d4568b0327bcd54e668b 100644 (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);
        }