diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-12-08 02:40:17 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-08 08:29:05 -0800 |
commit | fd717689f46436fc212882ddc6e02a20be920634 (patch) | |
tree | 4b4a7bd76f23716fbd14886cfdfb9aab7033b2f8 /drivers/video/riva/riva_hw.c | |
parent | 945f0ee257b4f91498b4061dc89b8a68c423ea6f (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/riva/riva_hw.c')
-rw-r--r-- | drivers/video/riva/riva_hw.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/video/riva/riva_hw.c b/drivers/video/riva/riva_hw.c index b6f8690b96c..e0b8c521cc9 100644 --- a/drivers/video/riva/riva_hw.c +++ b/drivers/video/riva/riva_hw.c @@ -1227,7 +1227,7 @@ static int CalcVClock * Calculate extended mode parameters (SVGA) and save in a * mode state structure. */ -static void CalcStateExt +int CalcStateExt ( RIVA_HW_INST *chip, RIVA_HW_STATE *state, @@ -1249,7 +1249,8 @@ static void CalcStateExt * Extended RIVA registers. */ pixelDepth = (bpp + 1)/8; - CalcVClock(dotClock, &VClk, &m, &n, &p, chip); + if (!CalcVClock(dotClock, &VClk, &m, &n, &p, chip)) + return -EINVAL; switch (chip->Architecture) { @@ -1327,6 +1328,8 @@ static void CalcStateExt state->pitch1 = state->pitch2 = state->pitch3 = pixelDepth * width; + + return 0; } /* * Load fixed function state and pre-calculated/stored state. @@ -2026,7 +2029,6 @@ static void nv3GetConfig */ chip->Busy = nv3Busy; chip->ShowHideCursor = ShowHideCursor; - chip->CalcStateExt = CalcStateExt; chip->LoadStateExt = LoadStateExt; chip->UnloadStateExt = UnloadStateExt; chip->SetStartAddress = SetStartAddress3; @@ -2084,7 +2086,6 @@ static void nv4GetConfig */ chip->Busy = nv4Busy; chip->ShowHideCursor = ShowHideCursor; - chip->CalcStateExt = CalcStateExt; chip->LoadStateExt = LoadStateExt; chip->UnloadStateExt = UnloadStateExt; chip->SetStartAddress = SetStartAddress; @@ -2186,7 +2187,6 @@ static void nv10GetConfig */ chip->Busy = nv10Busy; chip->ShowHideCursor = ShowHideCursor; - chip->CalcStateExt = CalcStateExt; chip->LoadStateExt = LoadStateExt; chip->UnloadStateExt = UnloadStateExt; chip->SetStartAddress = SetStartAddress; |