diff options
-rw-r--r-- | drivers/video/aty/aty128fb.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c index bfc8a93b2c73..620c9a934e0e 100644 --- a/drivers/video/aty/aty128fb.c +++ b/drivers/video/aty/aty128fb.c | |||
@@ -1326,7 +1326,7 @@ static int aty128_var_to_pll(u32 period_in_ps, struct aty128_pll *pll, | |||
1326 | unsigned char post_dividers[] = {1,2,4,8,3,6,12}; | 1326 | unsigned char post_dividers[] = {1,2,4,8,3,6,12}; |
1327 | u32 output_freq; | 1327 | u32 output_freq; |
1328 | u32 vclk; /* in .01 MHz */ | 1328 | u32 vclk; /* in .01 MHz */ |
1329 | int i; | 1329 | int i = 0; |
1330 | u32 n, d; | 1330 | u32 n, d; |
1331 | 1331 | ||
1332 | vclk = 100000000 / period_in_ps; /* convert units to 10 kHz */ | 1332 | vclk = 100000000 / period_in_ps; /* convert units to 10 kHz */ |
@@ -1340,15 +1340,16 @@ static int aty128_var_to_pll(u32 period_in_ps, struct aty128_pll *pll, | |||
1340 | /* now, find an acceptable divider */ | 1340 | /* now, find an acceptable divider */ |
1341 | for (i = 0; i < sizeof(post_dividers); i++) { | 1341 | for (i = 0; i < sizeof(post_dividers); i++) { |
1342 | output_freq = post_dividers[i] * vclk; | 1342 | output_freq = post_dividers[i] * vclk; |
1343 | if (output_freq >= c.ppll_min && output_freq <= c.ppll_max) | 1343 | if (output_freq >= c.ppll_min && output_freq <= c.ppll_max) { |
1344 | pll->post_divider = post_dividers[i]; | ||
1344 | break; | 1345 | break; |
1346 | } | ||
1345 | } | 1347 | } |
1346 | 1348 | ||
1347 | /* calculate feedback divider */ | 1349 | /* calculate feedback divider */ |
1348 | n = c.ref_divider * output_freq; | 1350 | n = c.ref_divider * output_freq; |
1349 | d = c.ref_clk; | 1351 | d = c.ref_clk; |
1350 | 1352 | ||
1351 | pll->post_divider = post_dividers[i]; | ||
1352 | pll->feedback_divider = round_div(n, d); | 1353 | pll->feedback_divider = round_div(n, d); |
1353 | pll->vclk = vclk; | 1354 | pll->vclk = vclk; |
1354 | 1355 | ||