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>
This commit is contained in:
@@ -88,8 +88,8 @@ static unsigned long ccu_mult_recalc_rate(struct clk_hw *hw,
|
||||
val = reg >> cm->mult.shift;
|
||||
val &= (1 << cm->mult.width) - 1;
|
||||
|
||||
ccu_mux_helper_adjust_parent_for_prediv(&cm->common, &cm->mux, -1,
|
||||
&parent_rate);
|
||||
parent_rate = ccu_mux_helper_apply_prediv(&cm->common, &cm->mux, -1,
|
||||
parent_rate);
|
||||
|
||||
return parent_rate * (val + cm->mult.offset);
|
||||
}
|
||||
@@ -116,8 +116,8 @@ static int ccu_mult_set_rate(struct clk_hw *hw, unsigned long rate,
|
||||
else
|
||||
ccu_frac_helper_disable(&cm->common, &cm->frac);
|
||||
|
||||
ccu_mux_helper_adjust_parent_for_prediv(&cm->common, &cm->mux, -1,
|
||||
&parent_rate);
|
||||
parent_rate = ccu_mux_helper_apply_prediv(&cm->common, &cm->mux, -1,
|
||||
parent_rate);
|
||||
|
||||
_cm.min = cm->mult.min;
|
||||
|
||||
|
Reference in New Issue
Block a user