linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / sound / pci / korg1212 / korg1212.c
index cfea51f..4eddb51 100644 (file)
@@ -27,7 +27,6 @@
 #include <linux/slab.h>
 #include <linux/wait.h>
 #include <linux/moduleparam.h>
-#include <linux/mutex.h>
 
 #include <sound/core.h>
 #include <sound/info.h>
@@ -326,7 +325,7 @@ struct snd_korg1212 {
         int irq;
 
         spinlock_t    lock;
-       struct mutex open_mutex;
+       struct semaphore open_mutex;
 
        struct timer_list timer;        /* timer callback for checking ack of stop request */
        int stop_pending_cnt;           /* counter for stop pending check */
@@ -668,13 +667,13 @@ static int snd_korg1212_OpenCard(struct snd_korg1212 * korg1212)
 {
        K1212_DEBUG_PRINTK("K1212_DEBUG: OpenCard [%s] %d\n",
                           stateName[korg1212->cardState], korg1212->opencnt);
-       mutex_lock(&korg1212->open_mutex);
+       down(&korg1212->open_mutex);
         if (korg1212->opencnt++ == 0) {
                snd_korg1212_TurnOffIdleMonitor(korg1212);
                snd_korg1212_setCardState(korg1212, K1212_STATE_OPEN);
        }
 
-       mutex_unlock(&korg1212->open_mutex);
+       up(&korg1212->open_mutex);
         return 1;
 }
 
@@ -683,9 +682,9 @@ static int snd_korg1212_CloseCard(struct snd_korg1212 * korg1212)
        K1212_DEBUG_PRINTK("K1212_DEBUG: CloseCard [%s] %d\n",
                           stateName[korg1212->cardState], korg1212->opencnt);
 
-       mutex_lock(&korg1212->open_mutex);
+       down(&korg1212->open_mutex);
        if (--(korg1212->opencnt)) {
-               mutex_unlock(&korg1212->open_mutex);
+               up(&korg1212->open_mutex);
                return 0;
        }
 
@@ -696,7 +695,7 @@ static int snd_korg1212_CloseCard(struct snd_korg1212 * korg1212)
                        K1212_DEBUG_PRINTK("K1212_DEBUG: CloseCard - RC = %d [%s]\n",
                                           rc, stateName[korg1212->cardState]);
                if (rc != K1212_CMDRET_Success) {
-                       mutex_unlock(&korg1212->open_mutex);
+                       up(&korg1212->open_mutex);
                         return 0;
                }
         } else if (korg1212->cardState > K1212_STATE_SETUP) {
@@ -708,7 +707,7 @@ static int snd_korg1212_CloseCard(struct snd_korg1212 * korg1212)
                 snd_korg1212_setCardState(korg1212, K1212_STATE_READY);
        }
 
-       mutex_unlock(&korg1212->open_mutex);
+       up(&korg1212->open_mutex);
         return 0;
 }
 
@@ -2085,7 +2084,7 @@ static void __devinit snd_korg1212_proc_init(struct snd_korg1212 *korg1212)
        struct snd_info_entry *entry;
 
        if (! snd_card_proc_new(korg1212->card, "korg1212", &entry))
-               snd_info_set_text_ops(entry, korg1212, snd_korg1212_proc_read);
+               snd_info_set_text_ops(entry, korg1212, 1024, snd_korg1212_proc_read);
 }
 
 static int
@@ -2180,7 +2179,7 @@ static int __devinit snd_korg1212_create(struct snd_card *card, struct pci_dev *
 
         init_waitqueue_head(&korg1212->wait);
         spin_lock_init(&korg1212->lock);
-       mutex_init(&korg1212->open_mutex);
+       init_MUTEX(&korg1212->open_mutex);
        init_timer(&korg1212->timer);
        korg1212->timer.function = snd_korg1212_timer_func;
        korg1212->timer.data = (unsigned long)korg1212;
@@ -2237,7 +2236,7 @@ static int __devinit snd_korg1212_create(struct snd_card *card, struct pci_dev *
         }
 
         err = request_irq(pci->irq, snd_korg1212_interrupt,
-                          IRQF_DISABLED|IRQF_SHARED,
+                          SA_INTERRUPT|SA_SHIRQ,
                           "korg1212", korg1212);
 
         if (err) {