Skip to contentSkip to conversation

fbdev: Fix access to ROM in aty128fb

PATCH In review Antonino A. Daplas 2 participants 2 messages Nov 2, 2004 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 2/8 fbdev: Fix access to ROM in aty128fb

Fix access to ROM in aty128fb. Found by sparse.

---

 aty128fb.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/video/aty/aty128fb.c +1 -1
diff -Nru a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
@@ -939,7 +939,7 @@
                 rom_base = ioremap(segstart, 0x10000);
 		if (rom_base == NULL)
 			return NULL;
-                if ((*rom_base == 0x55) && (((*(rom_base + 1)) & 0xff) == 0xaa))
+		if (readb(rom_base) == 0x55 && readb(rom_base + 1) == 0xaa)
 	                break;
                 iounmap(rom_base);
 		rom_base = NULL;

-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click

#1 lore raw

Have you looked at the new PCI API for ROM access in the -mm tree yet? It is in the bk-pci patch and should be going into linus' tree sooner or later. It will allow you to get rid of some common code in a lot of the fbdev drivers.

pci_map_rom/pci_unmap_rom

It also tracks the boot video card. pci_map_rom for that card returns a pointer to the shadow ROM copy at C0000. That let's you transparently get to laptop ROMs that are stored compressed in the system ROM.

Signature · 9 lines
Jon Smirl
[email protected]


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click