#include <linux/slab.h>
#include <linux/wait.h>
#include <linux/moduleparam.h>
-#include <linux/mutex.h>
#include <sound/core.h>
#include <sound/info.h>
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 */
MODULE_PARM_DESC(enable, "Enable Korg 1212 soundcard.");
MODULE_AUTHOR("Haroldo Gamal <gamal@alternex.com.br>");
-static struct pci_device_id snd_korg1212_ids[] __devinitdata = {
+static struct pci_device_id snd_korg1212_ids[] = {
{
.vendor = 0x10b5,
.device = 0x906d,
{
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;
}
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;
}
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) {
snd_korg1212_setCardState(korg1212, K1212_STATE_READY);
}
- mutex_unlock(&korg1212->open_mutex);
+ up(&korg1212->open_mutex);
return 0;
}
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;