[PATCH] 27/41 sound/oss/opl3sa2.c - convert cli to spinlocks

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


--- vanilla-2.5.32/sound/oss/opl3sa2.c Sat Apr 20 18:25:21 2002
+++ linux-2.5-cli-oss/sound/oss/opl3sa2.c Tue Aug 13 15:37:21 2002
@@ -149,6 +149,8 @@
 static struct address_info cfg_mss[OPL3SA2_CARDS_MAX];
 static struct address_info cfg_mpu[OPL3SA2_CARDS_MAX];
 
+static spinlock_t lock=SPIN_LOCK_UNLOCKED;
+
 /* Our parameters */
 static int __initdata io = -1;
 static int __initdata mss_io = -1;
@@ -927,8 +929,7 @@
         if (!pdev)
                 return -EINVAL;
 
- save_flags(flags);
- cli();
+ spin_lock_irqsave(&lock,flags);
 
         p = (opl3sa2_mixerdata *) pdev->data;
         p->in_suspend = 1;
@@ -951,7 +952,7 @@
         opl3sa2_read(p->cfg_port, OPL3SA2_PM, &p->reg);
         opl3sa2_write(p->cfg_port, OPL3SA2_PM, p->reg | pm_mode);
 
- restore_flags(flags);
+ spin_unlock_irqrestore(&lock,flags);
         return 0;
 }
 
@@ -964,15 +965,14 @@
                 return -EINVAL;
 
         p = (opl3sa2_mixerdata *) pdev->data;
- save_flags(flags);
- cli();
+ spin_lock_irqsave(&lock,flags);
 
         /* I don't think this is necessary */
         opl3sa2_write(p->cfg_port, OPL3SA2_PM, p->reg);
         opl3sa2_mixer_restore(p, p->card);
         p->in_suspend = 0;
 
- restore_flags(flags);
+ spin_unlock_irqrestore(&lock,flags);
         return 0;
 }
 

-
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