2014-09-19 00:12:53 +00:00
|
|
|
--- a/drivers/clk/sunxi/clk-sunxi.c
|
|
|
|
+++ b/drivers/clk/sunxi/clk-sunxi.c
|
2014-12-08 12:04:25 +00:00
|
|
|
@@ -299,7 +299,7 @@ static void sun4i_get_apb1_factors(u32 *
|
2014-09-19 00:12:53 +00:00
|
|
|
if (parent_rate < *freq)
|
|
|
|
*freq = parent_rate;
|
|
|
|
|
|
|
|
- parent_rate = (parent_rate + (*freq - 1)) / *freq;
|
|
|
|
+ parent_rate = DIV_ROUND_UP(parent_rate, *freq);
|
|
|
|
|
|
|
|
/* Invalid rate! */
|
|
|
|
if (parent_rate > 32)
|
2014-12-08 12:04:25 +00:00
|
|
|
@@ -344,7 +344,7 @@ static void sun4i_get_mod0_factors(u32 *
|
2014-09-19 00:12:53 +00:00
|
|
|
if (*freq > parent_rate)
|
|
|
|
*freq = parent_rate;
|
|
|
|
|
|
|
|
- div = parent_rate / *freq;
|
|
|
|
+ div = DIV_ROUND_UP(parent_rate, *freq);
|
|
|
|
|
|
|
|
if (div < 16)
|
|
|
|
calcp = 0;
|
2014-12-08 12:04:25 +00:00
|
|
|
@@ -385,7 +385,7 @@ static void sun7i_a20_get_out_factors(u3
|
2014-09-19 00:12:53 +00:00
|
|
|
if (*freq > parent_rate)
|
|
|
|
*freq = parent_rate;
|
|
|
|
|
|
|
|
- div = parent_rate / *freq;
|
|
|
|
+ div = DIV_ROUND_UP(parent_rate, *freq);
|
|
|
|
|
|
|
|
if (div < 32)
|
|
|
|
calcp = 0;
|