{
unsigned long flags;
- mutex_lock(&chip->open_mutex);
+ down(&chip->open_mutex);
if (chip->mode & AD1848_MODE_OPEN) {
- mutex_unlock(&chip->open_mutex);
+ up(&chip->open_mutex);
return -EAGAIN;
}
snd_ad1848_mce_down(chip);
spin_unlock_irqrestore(&chip->reg_lock, flags);
chip->mode = mode;
- mutex_unlock(&chip->open_mutex);
+ up(&chip->open_mutex);
return 0;
}
{
unsigned long flags;
- mutex_lock(&chip->open_mutex);
+ down(&chip->open_mutex);
if (!chip->mode) {
- mutex_unlock(&chip->open_mutex);
+ up(&chip->open_mutex);
return;
}
/* disable IRQ */
spin_unlock_irqrestore(&chip->reg_lock, flags);
chip->mode = 0;
- mutex_unlock(&chip->open_mutex);
+ up(&chip->open_mutex);
}
/*
if (chip == NULL)
return -ENOMEM;
spin_lock_init(&chip->reg_lock);
- mutex_init(&chip->open_mutex);
+ init_MUTEX(&chip->open_mutex);
chip->card = card;
chip->port = port;
chip->irq = -1;