]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
clk: Update drivers to use -EINVAL
authorSimon Glass <sjg@chromium.org>
Wed, 24 Mar 2021 21:26:08 +0000 (10:26 +1300)
committerSimon Glass <sjg@chromium.org>
Tue, 6 Apr 2021 04:33:19 +0000 (16:33 +1200)
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 <sjg@chromium.org>
Acked-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
drivers/clk/aspeed/clk_ast2600.c
drivers/clk/clk-hsdk-cgu.c
drivers/clk/imx/clk-imx8.c
drivers/clk/imx/clk-imx8qm.c
drivers/clk/imx/clk-imx8qxp.c
drivers/clk/imx/clk-pllv3.c
drivers/clk/kendryte/bypass.c
drivers/clk/kendryte/clk.c
drivers/clk/mvebu/armada-37xx-periph.c

index acb7eca74144522e4d22ff2dc14b7b8963863c89..3a92739f5cf5332a11d3502c8243bfbd7c7fbb73 100644 (file)
@@ -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;
index 449b430e23063e3883ea1ec2d8ef1e09968e808b..26b0aa9a26f8d3215fc47dd18fcd154be7199654 100644 (file)
@@ -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 = {
index 8484613eed5c37f5c0cc247e12eeb91c6d8e7656..b3dc138c4bb9716962296a361b3d89458230bfae 100644 (file)
@@ -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;
index 7e466d630a079c2c15c0d0e6a833f3f66e0b960a..7759dc63ee1b05ae050f59903955ff62e4f07133 100644 (file)
@@ -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);
index e6b2fb40da2a8bd2a967b1bbe05f399f60d47fea..ffa2fcee0b2fa86ba01d4ef58e3ce6fa89b1cef8 100644 (file)
@@ -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);
index feacaee1c42b9a9d3577dd2e00da2f784f614eeb..b5cbf800543b4b93b0cb2425beeb6e4c0c54d69f 100644 (file)
@@ -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;
index 5f1986f2cb80b222f5a34b8afe4ae0ee0e7841b5..bbdbd9a10dee7e597782a3646dcdbf1c50655610 100644 (file)
@@ -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;
 }
 
 /*
index 4b959401a63d655a9a6cc8c770b0c392efb75359..3b674a998e3f61472326c90cbdffa7526cb201af 100644 (file)
@@ -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)
index 0132fcb7e61d904a4cf8a92a7f1c35636ee0a82f..b0f47c33b3f755a919c02f1cec49b1242af06739 100644 (file)
@@ -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)