Commit 03e95caf authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] fix vga16fb.c frame buffer bad memory mapping

From: Vincent Sanders <vince@kyllikki.org>

The vga16fb driver uses a direct ioremap on 0xa00000 to gain access to the
vga card.  This is wrong on architectures other than x86, every other driver
uses VGA_MAP_MEM macro from vga.h to ensure the correct memory mapping.
parent b52b3a2b
...@@ -1347,7 +1347,7 @@ int __init vga16fb_init(void) ...@@ -1347,7 +1347,7 @@ int __init vga16fb_init(void)
/* XXX share VGA_FB_PHYS and I/O region with vgacon and others */ /* XXX share VGA_FB_PHYS and I/O region with vgacon and others */
vga16fb.screen_base = ioremap(VGA_FB_PHYS, VGA_FB_PHYS_LEN); vga16fb.screen_base = ioremap(VGA_MAP_MEM(VGA_FB_PHYS), VGA_FB_PHYS_LEN);
if (!vga16fb.screen_base) { if (!vga16fb.screen_base) {
printk(KERN_ERR "vga16fb: unable to map device\n"); printk(KERN_ERR "vga16fb: unable to map device\n");
ret = -ENOMEM; ret = -ENOMEM;
...@@ -1372,6 +1372,8 @@ int __init vga16fb_init(void) ...@@ -1372,6 +1372,8 @@ int __init vga16fb_init(void)
vga16fb.par = &vga16_par; vga16fb.par = &vga16_par;
vga16fb.flags = FBINFO_FLAG_DEFAULT; vga16fb.flags = FBINFO_FLAG_DEFAULT;
vga16fb.fix.smem_start = VGA_MAP_MEM(vga16fb.fix.smem_start);
i = (vga16fb_defined.bits_per_pixel == 8) ? 256 : 16; i = (vga16fb_defined.bits_per_pixel == 8) ? 256 : 16;
ret = fb_alloc_cmap(&vga16fb.cmap, i, 0); ret = fb_alloc_cmap(&vga16fb.cmap, i, 0);
if (ret) { if (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment