patch-2.3.15 linux/drivers/video/fbmem.c

Next file: linux/drivers/video/fm2fb.c
Previous file: linux/drivers/video/dnfb.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.14/linux/drivers/video/fbmem.c linux/drivers/video/fbmem.c
@@ -470,10 +470,18 @@
 		return -ENODEV;
 	if (fb->fb_mmap)
 		return fb->fb_mmap(info, file, vma);
+
+#if defined(__sparc__)
+	/* Should never get here, all fb drivers should have their own
+	   mmap routines */
+	return -EINVAL;
+#else
+	/* non-SPARC... */
+
 	fb->fb_get_fix(&fix, PROC_CONSOLE(info), info);
 
 	/* frame buffer memory */
-	start = (unsigned long)fix.smem_start;
+	start = fix.smem_start;
 	len = (start & ~PAGE_MASK)+fix.smem_len;
 	start &= PAGE_MASK;
 	len = (len+~PAGE_MASK) & PAGE_MASK;
@@ -483,7 +491,7 @@
 		fb->fb_get_var(&var, PROC_CONSOLE(info), info);
 		if (var.accel_flags)
 			return -EINVAL;
-		start = (unsigned long)fix.mmio_start;
+		start = fix.mmio_start;
 		len = (start & ~PAGE_MASK)+fix.mmio_len;
 		start &= PAGE_MASK;
 		len = (len+~PAGE_MASK) & PAGE_MASK;
@@ -505,9 +513,6 @@
 	pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE|_PAGE_GUARDED;
 #elif defined(__alpha__)
 	/* Caching is off in the I/O space quadrant by design.  */
-#elif defined(__sparc__)
-	/* Should never get here, all fb drivers should have their own
-	   mmap routines */
 #elif defined(__i386__)
 	if (boot_cpu_data.x86 > 3)
 		pgprot_val(vma->vm_page_prot) |= _PAGE_PCD;
@@ -524,10 +529,12 @@
 #else
 #warning What do we have to do here??
 #endif
-	if (remap_page_range(vma->vm_start, vma->vm_offset,
+	if (io_remap_page_range(vma->vm_start, vma->vm_offset,
 			     vma->vm_end - vma->vm_start, vma->vm_page_prot))
 		return -EAGAIN;
 	return 0;
+
+#endif /* defined(__sparc__) */
 }
 
 static int

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)