From: Simon Glass Date: Wed, 24 Mar 2021 21:26:08 +0000 (+1300) Subject: clk: Update drivers to use -EINVAL X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=9042bf6fe415c319958637b5e8b44ea4cf6f3a76;p=u-boot.git clk: Update drivers to use -EINVAL At present some drivers use -ENOSUPP to indicate that an unknown or unsupported clock is used. Most use -EINVAL, indicating an invalid value, so convert everything to that. Signed-off-by: Simon Glass Acked-by: Sean Anderson Reviewed-by: Stefan Roese --- diff --git a/drivers/clk/aspeed/clk_ast2600.c b/drivers/clk/aspeed/clk_ast2600.c index acb7eca741..3a92739f5c 100644 --- a/drivers/clk/aspeed/clk_ast2600.c +++ b/drivers/clk/aspeed/clk_ast2600.c @@ -1140,7 +1140,7 @@ int soc_clk_dump(void) clk_free(&clk); - if (ret == -ENOTSUPP) { + if (ret == -EINVAL) { printf("clk ID %lu not supported yet\n", aspeed_clk_names[i].id); continue; diff --git a/drivers/clk/clk-hsdk-cgu.c b/drivers/clk/clk-hsdk-cgu.c index 449b430e23..26b0aa9a26 100644 --- a/drivers/clk/clk-hsdk-cgu.c +++ b/drivers/clk/clk-hsdk-cgu.c @@ -718,7 +718,7 @@ static ulong hsdk_cgu_set_rate(struct clk *sclk, ulong rate) if (clk->map[sclk->id].set_rate) return clk->map[sclk->id].set_rate(sclk, rate); - return -ENOTSUPP; + return -EINVAL; } static int hsdk_cgu_disable(struct clk *sclk) @@ -731,7 +731,7 @@ static int hsdk_cgu_disable(struct clk *sclk) if (clk->map[sclk->id].disable) return clk->map[sclk->id].disable(sclk); - return -ENOTSUPP; + return -EINVAL; } static const struct clk_ops hsdk_cgu_ops = { diff --git a/drivers/clk/imx/clk-imx8.c b/drivers/clk/imx/clk-imx8.c index 8484613eed..b3dc138c4b 100644 --- a/drivers/clk/imx/clk-imx8.c +++ b/drivers/clk/imx/clk-imx8.c @@ -29,7 +29,7 @@ __weak ulong imx8_clk_set_rate(struct clk *clk, unsigned long rate) __weak int __imx8_clk_enable(struct clk *clk, bool enable) { - return -ENOTSUPP; + return -EINVAL; } static int imx8_clk_disable(struct clk *clk) @@ -70,7 +70,7 @@ int soc_clk_dump(void) clk_free(&clk); - if (ret == -ENOTSUPP) { + if (ret == -EINVAL) { printf("clk ID %lu not supported yet\n", imx8_clk_names[i].id); continue; diff --git a/drivers/clk/imx/clk-imx8qm.c b/drivers/clk/imx/clk-imx8qm.c index 7e466d630a..7759dc63ee 100644 --- a/drivers/clk/imx/clk-imx8qm.c +++ b/drivers/clk/imx/clk-imx8qm.c @@ -133,7 +133,7 @@ ulong imx8_clk_get_rate(struct clk *clk) __func__, clk->id); return -EINVAL; } - return -ENOTSUPP; + return -EINVAL; }; ret = sc_pm_get_clock_rate(-1, resource, pm_clk, @@ -237,7 +237,7 @@ ulong imx8_clk_set_rate(struct clk *clk, unsigned long rate) __func__, clk->id); return -EINVAL; } - return -ENOTSUPP; + return -EINVAL; }; ret = sc_pm_set_clock_rate(-1, resource, pm_clk, &new_rate); @@ -337,7 +337,7 @@ int __imx8_clk_enable(struct clk *clk, bool enable) __func__, clk->id); return -EINVAL; } - return -ENOTSUPP; + return -EINVAL; } ret = sc_pm_clock_enable(-1, resource, pm_clk, enable, 0); diff --git a/drivers/clk/imx/clk-imx8qxp.c b/drivers/clk/imx/clk-imx8qxp.c index e6b2fb40da..ffa2fcee0b 100644 --- a/drivers/clk/imx/clk-imx8qxp.c +++ b/drivers/clk/imx/clk-imx8qxp.c @@ -126,7 +126,7 @@ ulong imx8_clk_get_rate(struct clk *clk) __func__, clk->id); return -EINVAL; } - return -ENOTSUPP; + return -EINVAL; }; ret = sc_pm_get_clock_rate(-1, resource, pm_clk, @@ -221,7 +221,7 @@ ulong imx8_clk_set_rate(struct clk *clk, unsigned long rate) __func__, clk->id); return -EINVAL; } - return -ENOTSUPP; + return -EINVAL; }; ret = sc_pm_set_clock_rate(-1, resource, pm_clk, &new_rate); @@ -311,7 +311,7 @@ int __imx8_clk_enable(struct clk *clk, bool enable) __func__, clk->id); return -EINVAL; } - return -ENOTSUPP; + return -EINVAL; } ret = sc_pm_clock_enable(-1, resource, pm_clk, enable, 0); diff --git a/drivers/clk/imx/clk-pllv3.c b/drivers/clk/imx/clk-pllv3.c index feacaee1c4..b5cbf80054 100644 --- a/drivers/clk/imx/clk-pllv3.c +++ b/drivers/clk/imx/clk-pllv3.c @@ -290,7 +290,7 @@ struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name, break; default: kfree(pll); - return ERR_PTR(-ENOTSUPP); + return ERR_PTR(-EINVAL); } pll->base = base; diff --git a/drivers/clk/kendryte/bypass.c b/drivers/clk/kendryte/bypass.c index 5f1986f2cb..bbdbd9a10d 100644 --- a/drivers/clk/kendryte/bypass.c +++ b/drivers/clk/kendryte/bypass.c @@ -157,7 +157,7 @@ static int k210_bypass_set_parent(struct clk *clk, struct clk *parent) if (ops->set_parent) return ops->set_parent(bypass->bypassee, parent); else - return -ENOTSUPP; + return -EINVAL; } /* diff --git a/drivers/clk/kendryte/clk.c b/drivers/clk/kendryte/clk.c index 4b959401a6..3b674a998e 100644 --- a/drivers/clk/kendryte/clk.c +++ b/drivers/clk/kendryte/clk.c @@ -495,7 +495,7 @@ static int k210_clk_probe(struct udevice *dev) * could fix this, but it's Probably Not Worth It (TM). */ if (probed) - return -ENOTSUPP; + return -EINVAL; base = dev_read_addr_ptr(dev_get_parent(dev)); if (!base) diff --git a/drivers/clk/mvebu/armada-37xx-periph.c b/drivers/clk/mvebu/armada-37xx-periph.c index 0132fcb7e6..b0f47c33b3 100644 --- a/drivers/clk/mvebu/armada-37xx-periph.c +++ b/drivers/clk/mvebu/armada-37xx-periph.c @@ -340,7 +340,7 @@ static int periph_clk_enable(struct clk *clk, int enable) return -EINVAL; if (!periph_clk->can_gate) - return -ENOTSUPP; + return -EINVAL; if (enable) clrbits_le32(priv->reg + CLK_DIS, periph_clk->disable_bit); @@ -408,7 +408,7 @@ static ulong armada_37xx_periph_clk_set_rate(struct clk *clk, ulong req_rate) return old_rate; if (!periph_clk->can_gate || !periph_clk->dividers) - return -ENOTSUPP; + return -EINVAL; parent_rate = get_parent_rate(priv, clk->id); if (parent_rate == -EINVAL) @@ -445,7 +445,7 @@ static int armada_37xx_periph_clk_set_parent(struct clk *clk, return -EINVAL; if (!periph_clk->can_mux || !periph_clk->can_gate) - return -ENOTSUPP; + return -EINVAL; ret = clk_get_by_index(clk->dev, 0, &check_parent); if (ret < 0)