[U-Boot] [PATCH 4/4] rockchip: rk3288: Move rockchip_get_cru() out of the driver
Simon Glass
sjg at chromium.org
Sun Jul 17 23:23:18 CEST 2016
This function is called from outside the driver. It should be placed into
common SoC code. Move it.
The same could be done for rk3036 but is not attempted here.
Signed-off-by: Simon Glass <sjg at chromium.org>
---
arch/arm/mach-rockchip/rk3288/clk_rk3288.c | 15 +++++++++++++++
drivers/clk/clk_rk3288.c | 15 ---------------
2 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/arch/arm/mach-rockchip/rk3288/clk_rk3288.c b/arch/arm/mach-rockchip/rk3288/clk_rk3288.c
index 2099e34..b665009 100644
--- a/arch/arm/mach-rockchip/rk3288/clk_rk3288.c
+++ b/arch/arm/mach-rockchip/rk3288/clk_rk3288.c
@@ -15,3 +15,18 @@ int rockchip_get_clk(struct udevice **devp)
return uclass_get_device_by_driver(UCLASS_CLK,
DM_GET_DRIVER(rockchip_rk3288_cru), devp);
}
+
+void *rockchip_get_cru(void)
+{
+ struct rk3288_clk_priv *priv;
+ struct udevice *dev;
+ int ret;
+
+ ret = rockchip_get_clk(&dev);
+ if (ret)
+ return ERR_PTR(ret);
+
+ priv = dev_get_priv(dev);
+
+ return priv->cru;
+}
diff --git a/drivers/clk/clk_rk3288.c b/drivers/clk/clk_rk3288.c
index e8463f9..b1238fa 100644
--- a/drivers/clk/clk_rk3288.c
+++ b/drivers/clk/clk_rk3288.c
@@ -139,21 +139,6 @@ static const struct pll_div apll_init_cfg = PLL_DIVISORS(APLL_HZ, 1, 1);
static const struct pll_div gpll_init_cfg = PLL_DIVISORS(GPLL_HZ, 2, 2);
static const struct pll_div cpll_init_cfg = PLL_DIVISORS(CPLL_HZ, 1, 2);
-void *rockchip_get_cru(void)
-{
- struct rk3288_clk_priv *priv;
- struct udevice *dev;
- int ret;
-
- ret = rockchip_get_clk(&dev);
- if (ret)
- return ERR_PTR(ret);
-
- priv = dev_get_priv(dev);
-
- return priv->cru;
-}
-
static int rkclk_set_pll(struct rk3288_cru *cru, enum rk_clk_id clk_id,
const struct pll_div *div)
{
--
2.8.0.rc3.226.g39d4020
More information about the U-Boot
mailing list