changeset 6586:df10f81f1bfc

linux-2.5.x support patch by Sytse Wielinga <s.b.wieling at student.utwente.nl>
author alex
date Fri, 28 Jun 2002 16:35:37 +0000
parents eb10ce6b3f18
children f4d4ec337ddb
files drivers/mga_vid.c
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/drivers/mga_vid.c	Fri Jun 28 16:33:46 2002 +0000
+++ b/drivers/mga_vid.c	Fri Jun 28 16:35:37 2002 +0000
@@ -133,7 +133,9 @@
                 *endp = (char *)cp;
         return result;
 }
+#endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) || LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,5)
 static long simple_strtol(const char *cp,char **endp,unsigned int base)
 {
         if(*cp=='-')
@@ -1472,8 +1474,13 @@
 #ifdef MP_DEBUG
 	printk(KERN_DEBUG "mga_vid: mapping video memory into userspace\n");
 #endif	
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,3)
+	if(remap_page_range(vma, vma->vm_start, mga_mem_base + mga_src_base,
+		 vma->vm_end - vma->vm_start, vma->vm_page_prot)) 
+#else
 	if(remap_page_range(vma->vm_start, mga_mem_base + mga_src_base,
 		 vma->vm_end - vma->vm_start, vma->vm_page_prot)) 
+#endif
 	{
 		printk(KERN_ERR "mga_vid: error mapping video memory\n");
 		return(-EAGAIN);
@@ -1507,7 +1514,11 @@
 
 static int mga_vid_open(struct inode *inode, struct file *file)
 {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,2)
+	int minor = MINOR(inode->i_rdev.value);
+#else
 	int minor = MINOR(inode->i_rdev);
+#endif
 
 	if(minor != 0)
 	 return(-ENXIO);