patch-2.4.0-test4 linux/drivers/char/pc110pad.c

Next file: linux/drivers/char/pc_keyb.c
Previous file: linux/drivers/char/nvram.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test3/linux/drivers/char/pc110pad.c linux/drivers/char/pc110pad.c
@@ -41,6 +41,7 @@
 #include <linux/poll.h>
 #include <linux/ioport.h>
 #include <linux/interrupt.h>
+#include <linux/smp_lock.h>
 
 #include <asm/signal.h>
 #include <asm/io.h>
@@ -583,10 +584,11 @@
  
 static int close_pad(struct inode * inode, struct file * file)
 {
+	lock_kernel();
 	fasync_pad(-1, file, 0);
-	if (--active)
-		return 0;
-	outb(0x30, current_params.io+2);	/* switch off digitiser */
+	if (!--active)
+		outb(0x30, current_params.io+2);  /* switch off digitiser */
+	unlock_kernel();
 	return 0;
 }
 

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