aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/aty/aty128fb.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-12-08 05:40:17 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 11:29:05 -0500
commitfd717689f46436fc212882ddc6e02a20be920634 (patch)
tree4b4a7bd76f23716fbd14886cfdfb9aab7033b2f8 /drivers/video/aty/aty128fb.c
parent945f0ee257b4f91498b4061dc89b8a68c423ea6f (diff)
[PATCH] atyfb, rivafb: minor fixes
aty128fb: return an error in the unlikely event that we cannot calculate some key PLL info rivafb: * call CalcStateExt() directly, rather than via function pointers, since CalcStateExt() is the only value ever assigned to ->CalcStateExt(). * propagate error return back from CalcVClock() through callers Signed-off-by: Jeff Garzik <jeff@garzik.org> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video/aty/aty128fb.c')
-rw-r--r--drivers/video/aty/aty128fb.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
index 276a21530b95..3feddf89d100 100644
--- a/drivers/video/aty/aty128fb.c
+++ b/drivers/video/aty/aty128fb.c
@@ -1333,6 +1333,8 @@ static int aty128_var_to_pll(u32 period_in_ps, struct aty128_pll *pll,
1333 if (vclk * 12 < c.ppll_min) 1333 if (vclk * 12 < c.ppll_min)
1334 vclk = c.ppll_min/12; 1334 vclk = c.ppll_min/12;
1335 1335
1336 pll->post_divider = -1;
1337
1336 /* now, find an acceptable divider */ 1338 /* now, find an acceptable divider */
1337 for (i = 0; i < sizeof(post_dividers); i++) { 1339 for (i = 0; i < sizeof(post_dividers); i++) {
1338 output_freq = post_dividers[i] * vclk; 1340 output_freq = post_dividers[i] * vclk;
@@ -1342,6 +1344,9 @@ static int aty128_var_to_pll(u32 period_in_ps, struct aty128_pll *pll,
1342 } 1344 }
1343 } 1345 }
1344 1346
1347 if (pll->post_divider < 0)
1348 return -EINVAL;
1349
1345 /* calculate feedback divider */ 1350 /* calculate feedback divider */
1346 n = c.ref_divider * output_freq; 1351 n = c.ref_divider * output_freq;
1347 d = c.ref_clk; 1352 d = c.ref_clk;