summaryrefslogtreecommitdiffstats
path: root/drivers/clk/sunxi-ng/ccu_mp.c
diff options
context:
space:
mode:
authorMaxime Ripard2017-05-17 09:40:35 +0200
committerMaxime Ripard2017-06-07 15:32:13 +0200
commitd754b15951ffe3c85e2581eaa244ed4a82080970 (patch)
tree2869b3d3ebdef28966fb02da07930482b1987e59 /drivers/clk/sunxi-ng/ccu_mp.c
parentclk: sunxi-ng: mux: split out the pre-divider computation code (diff)
downloadkernel-qcow2-linux-d754b15951ffe3c85e2581eaa244ed4a82080970.tar.gz
kernel-qcow2-linux-d754b15951ffe3c85e2581eaa244ed4a82080970.tar.xz
kernel-qcow2-linux-d754b15951ffe3c85e2581eaa244ed4a82080970.zip
clk: sunxi-ng: mux: Change pre-divider application function prototype
The current function name is a bit confusing, and doesn't really allow to create an explicit function to reverse the operation. We also for now change the parent rate through a pointer, while we don't return anything. In order to be less confusing, and easier to use for downstream users, change the function name to something hopefully clearer, and return the adjusted rate instead of changing the pointer. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Diffstat (limited to 'drivers/clk/sunxi-ng/ccu_mp.c')
-rw-r--r--drivers/clk/sunxi-ng/ccu_mp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/clk/sunxi-ng/ccu_mp.c b/drivers/clk/sunxi-ng/ccu_mp.c
index de02e6c386d8..b917ad7a386c 100644
--- a/drivers/clk/sunxi-ng/ccu_mp.c
+++ b/drivers/clk/sunxi-ng/ccu_mp.c
@@ -87,8 +87,8 @@ static unsigned long ccu_mp_recalc_rate(struct clk_hw *hw,
u32 reg;
/* Adjust parent_rate according to pre-dividers */
- ccu_mux_helper_adjust_parent_for_prediv(&cmp->common, &cmp->mux,
- -1, &parent_rate);
+ parent_rate = ccu_mux_helper_apply_prediv(&cmp->common, &cmp->mux, -1,
+ parent_rate);
reg = readl(cmp->common.base + cmp->common.reg);
@@ -123,8 +123,8 @@ static int ccu_mp_set_rate(struct clk_hw *hw, unsigned long rate,
u32 reg;
/* Adjust parent_rate according to pre-dividers */
- ccu_mux_helper_adjust_parent_for_prediv(&cmp->common, &cmp->mux,
- -1, &parent_rate);
+ parent_rate = ccu_mux_helper_apply_prediv(&cmp->common, &cmp->mux, -1,
+ parent_rate);
max_m = cmp->m.max ?: 1 << cmp->m.width;
max_p = cmp->p.max ?: 1 << ((1 << cmp->p.width) - 1);