{
unsigned long flags;
- mutex_lock(&chip->mce_mutex);
+ guard(mutex)(&chip->mce_mutex);
snd_cs4231_calibrate_mute(chip, 1);
snd_cs4231_mce_up(chip);
snd_cs4231_mce_down(chip);
snd_cs4231_calibrate_mute(chip, 0);
- mutex_unlock(&chip->mce_mutex);
}
static void snd_cs4231_capture_format(struct snd_cs4231 *chip,
{
unsigned long flags;
- mutex_lock(&chip->mce_mutex);
+ guard(mutex)(&chip->mce_mutex);
snd_cs4231_calibrate_mute(chip, 1);
snd_cs4231_mce_up(chip);
snd_cs4231_mce_down(chip);
snd_cs4231_calibrate_mute(chip, 0);
- mutex_unlock(&chip->mce_mutex);
}
/*
{
unsigned long flags;
- mutex_lock(&chip->open_mutex);
- if ((chip->mode & mode)) {
- mutex_unlock(&chip->open_mutex);
+ guard(mutex)(&chip->open_mutex);
+ if ((chip->mode & mode))
return -EAGAIN;
- }
if (chip->mode & CS4231_MODE_OPEN) {
chip->mode |= mode;
- mutex_unlock(&chip->open_mutex);
return 0;
}
/* ok. now enable and ack CODEC IRQ */
spin_unlock_irqrestore(&chip->lock, flags);
chip->mode = mode;
- mutex_unlock(&chip->open_mutex);
return 0;
}
{
unsigned long flags;
- mutex_lock(&chip->open_mutex);
+ guard(mutex)(&chip->open_mutex);
chip->mode &= ~mode;
- if (chip->mode & CS4231_MODE_OPEN) {
- mutex_unlock(&chip->open_mutex);
+ if (chip->mode & CS4231_MODE_OPEN)
return;
- }
snd_cs4231_calibrate_mute(chip, 1);
/* disable IRQ */
snd_cs4231_calibrate_mute(chip, 0);
chip->mode = 0;
- mutex_unlock(&chip->open_mutex);
}
/*