patch-2.1.44 linux/drivers/sbus/char/sunfb.c

Next file: linux/drivers/sbus/char/sunkbd.c
Previous file: linux/drivers/sbus/char/suncons.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.43/linux/drivers/sbus/char/sunfb.c linux/drivers/sbus/char/sunfb.c
@@ -1,4 +1,4 @@
-/* $Id: sunfb.c,v 1.23 1997/05/31 18:33:26 mj Exp $
+/* $Id: sunfb.c,v 1.25 1997/07/01 09:12:06 jj Exp $
  * sunfb.c: Sun generic frame buffer support.
  *
  * Copyright (C) 1995, 1996 Miguel de Icaza (miguel@nuclecu.unam.mx)
@@ -132,7 +132,7 @@
 		if ((index < 0) || (index > 255))
 			return -EINVAL;
 		if (index + count > 256)
-			count = 256 - cmap->index;
+			count = 256 - index;
 		__get_user_ret(rp, &cmap->red, -EFAULT);
 		__get_user_ret(gp, &cmap->green, -EFAULT);
 		__get_user_ret(bp, &cmap->blue, -EFAULT);
@@ -146,7 +146,7 @@
 			__put_user_ret(fb->color_map CM(i,2), bp, -EFAULT);
 			rp++; gp++; bp++;
 		}
-		(*fb->loadcmap)(fb, cmap->index, count);
+		(*fb->loadcmap)(fb, index, count);
                 break;			
 
 	}
@@ -164,13 +164,13 @@
 		if ((index < 0) || (index > 255))
 			return -EINVAL;
 		if (index + count > 256)
-			count = 256 - cmap->index;
+			count = 256 - index;
 		__get_user_ret(rp, &cmap->red, -EFAULT);
 		__get_user_ret(gp, &cmap->green, -EFAULT);
 		__get_user_ret(bp, &cmap->blue, -EFAULT);
-		if(verify_area (VERIFY_READ, rp, cmap->count)) return -EFAULT;
-		if(verify_area (VERIFY_READ, gp, cmap->count)) return -EFAULT;
-		if(verify_area (VERIFY_READ, bp, cmap->count)) return -EFAULT;
+		if(verify_area (VERIFY_READ, rp, count)) return -EFAULT;
+		if(verify_area (VERIFY_READ, gp, count)) return -EFAULT;
+		if(verify_area (VERIFY_READ, bp, count)) return -EFAULT;
 
 		end = index + count;
 		for (i = index; i < end; i++){
@@ -179,7 +179,7 @@
 			__get_user_ret(fb->color_map CM(i,2), bp, -EFAULT);
 			rp++; gp++; bp++;
 		}
-		(*fb->loadcmap)(fb, cmap->index, count);
+		(*fb->loadcmap)(fb, index, count);
                 break;			
 	}
 
@@ -276,6 +276,7 @@
 		
 		v = (*fb->mmap)(inode, file, vma, fb->base, fb);
 		if (v) return v;
+		vma->vm_flags |= VM_IO;
 		if (!fb->mmaped) {
 			fb->mmaped = 1;
 			if (!minor) {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov