]> err.no Git - linux-2.6/commitdiff
rivafb: fix IO access
authorAntonino A. Daplas <adaplas@gmail.com>
Tue, 8 May 2007 07:38:43 +0000 (00:38 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 8 May 2007 18:15:29 +0000 (11:15 -0700)
Fix IO access, with the following sparse warnings:

drivers/video/riva/fbdev.c:320:25: warning: dereference of noderef expression
drivers/video/riva/fbdev.c:321:29: warning: dereference of noderef expression
drivers/video/riva/fbdev.c:327:18: warning: dereference of noderef expression
drivers/video/riva/fbdev.c:328:15: warning: dereference of noderef expression

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/riva/fbdev.c

index 9e6ee1ffd9f321d2c83d09ef61500b56e20837a6..19dff8dbe8afbeef2b2609436883da386527b565 100644 (file)
@@ -317,15 +317,15 @@ static int riva_bl_update_status(struct backlight_device *bd)
        else
                level = bd->props.brightness;
 
-       tmp_pmc = par->riva.PMC[0x10F0/4] & 0x0000FFFF;
-       tmp_pcrt = par->riva.PCRTC0[0x081C/4] & 0xFFFFFFFC;
+       tmp_pmc = NV_RD32(par->riva.PMC, 0x10F0) & 0x0000FFFF;
+       tmp_pcrt = NV_RD32(par->riva.PCRTC0, 0x081C) & 0xFFFFFFFC;
        if(level > 0) {
                tmp_pcrt |= 0x1;
                tmp_pmc |= (1 << 31); /* backlight bit */
                tmp_pmc |= riva_bl_get_level_brightness(par, level) << 16; /* level */
        }
-       par->riva.PCRTC0[0x081C/4] = tmp_pcrt;
-       par->riva.PMC[0x10F0/4] = tmp_pmc;
+       NV_WR32(par->riva.PCRTC0, 0x081C, tmp_pcrt);
+       NV_WR32(par->riva.PMC, 0x10F0, tmp_pmc);
 
        return 0;
 }