patch-2.4.1 linux/drivers/sbus/char/pcikbd.c

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

diff -u --recursive --new-file v2.4.0/linux/drivers/sbus/char/pcikbd.c linux/drivers/sbus/char/pcikbd.c
@@ -1,4 +1,4 @@
-/* $Id: pcikbd.c,v 1.49 2000/07/13 08:06:40 davem Exp $
+/* $Id: pcikbd.c,v 1.50 2001/01/11 15:29:36 davem Exp $
  * pcikbd.c: Ultra/AX PC keyboard support.
  *
  * Copyright (C) 1997  Eddie C. Dost  (ecd@skynet.be)
@@ -746,13 +746,13 @@
 {
 	unsigned long flags;
 
-	lock_kernel();
 	aux_fasync(-1, file, 0);
-	if (--aux_count)
-		goto out;
 
 	spin_lock_irqsave(&pcikbd_lock, flags);
 
+	if (--aux_count)
+		goto out;
+
 	/* Disable controller ints */
 	aux_write_cmd(AUX_INTS_OFF);
 	poll_aux_status();
@@ -761,9 +761,8 @@
 	pcimouse_outb(KBD_CCMD_MOUSE_DISABLE, pcimouse_iobase + KBD_CNTL_REG);
 	poll_aux_status();
 
-	spin_unlock_irqrestore(&pcikbd_lock, flags);
 out:
-	unlock_kernel();
+	spin_unlock_irqrestore(&pcikbd_lock, flags);
 
 	return 0;
 }
@@ -780,10 +779,12 @@
 	if (!aux_present)
 		return -ENODEV;
 
-	if (aux_count++)
-		return 0;
-
 	spin_lock_irqsave(&pcikbd_lock, flags);
+
+	if (aux_count++) {
+		spin_unlock_irqrestore(&pcikbd_lock, flags);
+		return 0;
+	}
 
 	if (!poll_aux_status()) {
 		aux_count--;

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