projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
741e96e
)
imx/clk-pllv2: fix wrong do_div() usage
author
Nicolas Pitre
<nicolas.pitre@linaro.org>
Wed, 4 Nov 2015 01:01:40 +0000
(20:01 -0500)
committer
Stephen Boyd
<sboyd@codeaurora.org>
Mon, 30 Nov 2015 20:58:38 +0000
(12:58 -0800)
do_div() is meant to be used with an unsigned dividend.
Signed-off-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/imx/clk-pllv2.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/clk/imx/clk-pllv2.c
b/drivers/clk/imx/clk-pllv2.c
index b18f875eac6acadd7e0ae27644fe8af0df240af6..4aeda56ce37279006a5cb8be93f9146d7e3d56d7 100644
(file)
--- a/
drivers/clk/imx/clk-pllv2.c
+++ b/
drivers/clk/imx/clk-pllv2.c
@@
-79,7
+79,7
@@
static unsigned long __clk_pllv2_recalc_rate(unsigned long parent_rate,
{
long mfi, mfn, mfd, pdf, ref_clk;
unsigned long dbl;
-
s
64 temp;
+
u
64 temp;
dbl = dp_ctl & MXC_PLL_DP_CTL_DPDCK0_2_EN;
@@
-98,8
+98,9
@@
static unsigned long __clk_pllv2_recalc_rate(unsigned long parent_rate,
temp = (u64) ref_clk * abs(mfn);
do_div(temp, mfd + 1);
if (mfn < 0)
- temp = -temp;
- temp = (ref_clk * mfi) + temp;
+ temp = (ref_clk * mfi) - temp;
+ else
+ temp = (ref_clk * mfi) + temp;
return temp;
}
@@
-126,7
+127,7
@@
static int __clk_pllv2_set_rate(unsigned long rate, unsigned long parent_rate,
{
u32 reg;
long mfi, pdf, mfn, mfd = 999999;
-
s
64 temp64;
+
u
64 temp64;
unsigned long quad_parent_rate;
quad_parent_rate = 4 * parent_rate;