]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
clk: k210: Remove k210_register_pll
authorSean Anderson <seanga2@gmail.com>
Fri, 9 Apr 2021 02:13:06 +0000 (22:13 -0400)
committerLeo Yu-Chi Liang <ycliang@andestech.com>
Fri, 14 May 2021 08:20:48 +0000 (16:20 +0800)
This simplifies the PLL creation process, since we don't have to pass all
the parameters individually.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
drivers/clk/kendryte/clk.c
drivers/clk/kendryte/pll.c
include/kendryte/pll.h

index 3b674a998e3f61472326c90cbdffa7526cb201af..ab86533bb4f1ec4ee8a437135d0343fe137a98b2 100644 (file)
@@ -528,14 +528,10 @@ static int k210_clk_probe(struct udevice *dev)
                return -ENOMEM;
        }
 
-       {
-               const struct k210_pll_params *params = &k210_plls[1];
-
+       pll = k210_create_pll(&k210_plls[1], base);
+       if (pll)
                clk_dm(K210_CLK_PLL1,
-                      k210_register_pll("pll1", in0, base + params->off,
-                                        base + params->lock_off, params->shift,
-                                        params->width));
-       }
+                      k210_register_pll_struct("pll1", in0, pll));
 
        /* PLL2 is muxed, so set up a composite clock */
        mux = k210_create_mux(&k210_muxes[MUXIFY(K210_CLK_PLL2)], base);
index d46fd0ebbf9676f00911e78d493ccd6834a2fb42..184f37aaf20404b79ae5c5286ac1f10b5666d125 100644 (file)
@@ -578,27 +578,6 @@ struct clk *k210_register_pll_struct(const char *name, const char *parent_name,
        return clk;
 }
 
-struct clk *k210_register_pll(const char *name, const char *parent_name,
-                             void __iomem *reg, void __iomem *lock, u8 shift,
-                             u8 width)
-{
-       struct clk *clk;
-       struct k210_pll *pll;
-
-       pll = kzalloc(sizeof(*pll), GFP_KERNEL);
-       if (!pll)
-               return ERR_PTR(-ENOMEM);
-       pll->reg = reg;
-       pll->lock = lock;
-       pll->shift = shift;
-       pll->width = width;
-
-       clk = k210_register_pll_struct(name, parent_name, pll);
-       if (IS_ERR(clk))
-               kfree(pll);
-       return clk;
-}
-
 U_BOOT_DRIVER(k210_pll) = {
        .name   = CLK_K210_PLL,
        .id     = UCLASS_CLK,
index 55a40b9c97969078730c7206752c235cf5ce2e44..95b8494f40f055cf165dc58f43e6b105203ad6d9 100644 (file)
@@ -55,8 +55,4 @@ extern const struct clk_ops k210_pll_ops;
 
 struct clk *k210_register_pll_struct(const char *name, const char *parent_name,
                                     struct k210_pll *pll);
-struct clk *k210_register_pll(const char *name, const char *parent_name,
-                             void __iomem *reg, void __iomem *lock, u8 shift,
-                             u8 width);
-
 #endif /* K210_PLL_H */