[PATCH] 23/41 sound/oss/mad16.c - convert cli to spinlocks

From: pwaechtler@mac.com
Date: Thu Aug 29 2002 - 14:56:27 EST


--- vanilla-2.5.32/sound/oss/mad16.c Sat Aug 10 00:08:54 2002
+++ linux-2.5-cli-oss/sound/oss/mad16.c Tue Aug 13 15:37:01 2002
@@ -43,7 +43,7 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/gameport.h>
-
+#include <linux/spinlock.h>
 #include "sound_config.h"
 
 #include "ad1848.h"
@@ -53,7 +53,7 @@
 static int mad16_conf;
 static int mad16_cdsel;
 static struct gameport gameport;
-
+static spinlock_t lock=SPIN_LOCK_UNLOCKED;
 static int already_initialized = 0;
 
 #define C928 1
@@ -106,8 +106,7 @@
         unsigned long flags;
         unsigned char tmp;
 
- save_flags(flags);
- cli();
+ spin_lock_irqsave(&lock,flags);
 
         switch (board_type) /* Output password */
         {
@@ -142,7 +141,7 @@
                 if (!c924pnp)
                         tmp = inb(port); else
                         tmp = inb(port-0x80);
- restore_flags(flags);
+ spin_unlock_irqrestore(&lock,flags);
 
         return tmp;
 }
@@ -151,8 +150,7 @@
 {
         unsigned long flags;
 
- save_flags(flags);
- cli();
+ spin_lock_irqsave(&lock,flags);
 
         switch (board_type) /* Output password */
         {
@@ -185,7 +183,7 @@
                 if (!c924pnp)
                         outb(((unsigned char) (value & 0xff)), port); else
                         outb(((unsigned char) (value & 0xff)), port-0x80);
- restore_flags(flags);
+ spin_unlock_irqrestore(&lock,flags);
 }
 
 static int __init detect_c930(void)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Aug 31 2002 - 22:00:28 EST