Commit ca2df45a authored by Krzysztof Helt's avatar Krzysztof Helt Committed by Jaroslav Kysela

[ALSA] This patch removes open_mutex from the ad1848-lib as

open and close operations are called only from pcm layer
and mutexed there with pcm->open_mutex.
Signed-off-by: default avatarKrzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@perex.cz>
parent c2cbdbb1
...@@ -154,7 +154,6 @@ struct snd_ad1848 { ...@@ -154,7 +154,6 @@ struct snd_ad1848 {
#endif #endif
spinlock_t reg_lock; spinlock_t reg_lock;
struct mutex open_mutex;
}; };
/* exported functions */ /* exported functions */
......
...@@ -378,11 +378,9 @@ static int snd_ad1848_open(struct snd_ad1848 *chip, unsigned int mode) ...@@ -378,11 +378,9 @@ static int snd_ad1848_open(struct snd_ad1848 *chip, unsigned int mode)
{ {
unsigned long flags; unsigned long flags;
mutex_lock(&chip->open_mutex); if (chip->mode & AD1848_MODE_OPEN)
if (chip->mode & AD1848_MODE_OPEN) {
mutex_unlock(&chip->open_mutex);
return -EAGAIN; return -EAGAIN;
}
snd_ad1848_mce_down(chip); snd_ad1848_mce_down(chip);
#ifdef SNDRV_DEBUG_MCE #ifdef SNDRV_DEBUG_MCE
...@@ -423,7 +421,6 @@ static int snd_ad1848_open(struct snd_ad1848 *chip, unsigned int mode) ...@@ -423,7 +421,6 @@ static int snd_ad1848_open(struct snd_ad1848 *chip, unsigned int mode)
spin_unlock_irqrestore(&chip->reg_lock, flags); spin_unlock_irqrestore(&chip->reg_lock, flags);
chip->mode = mode; chip->mode = mode;
mutex_unlock(&chip->open_mutex);
return 0; return 0;
} }
...@@ -432,11 +429,8 @@ static void snd_ad1848_close(struct snd_ad1848 *chip) ...@@ -432,11 +429,8 @@ static void snd_ad1848_close(struct snd_ad1848 *chip)
{ {
unsigned long flags; unsigned long flags;
mutex_lock(&chip->open_mutex); if (!chip->mode)
if (!chip->mode) {
mutex_unlock(&chip->open_mutex);
return; return;
}
/* disable IRQ */ /* disable IRQ */
spin_lock_irqsave(&chip->reg_lock, flags); spin_lock_irqsave(&chip->reg_lock, flags);
outb(0, AD1848P(chip, STATUS)); /* clear IRQ */ outb(0, AD1848P(chip, STATUS)); /* clear IRQ */
...@@ -462,7 +456,6 @@ static void snd_ad1848_close(struct snd_ad1848 *chip) ...@@ -462,7 +456,6 @@ static void snd_ad1848_close(struct snd_ad1848 *chip)
spin_unlock_irqrestore(&chip->reg_lock, flags); spin_unlock_irqrestore(&chip->reg_lock, flags);
chip->mode = 0; chip->mode = 0;
mutex_unlock(&chip->open_mutex);
} }
/* /*
...@@ -880,7 +873,6 @@ int snd_ad1848_create(struct snd_card *card, ...@@ -880,7 +873,6 @@ int snd_ad1848_create(struct snd_card *card,
if (chip == NULL) if (chip == NULL)
return -ENOMEM; return -ENOMEM;
spin_lock_init(&chip->reg_lock); spin_lock_init(&chip->reg_lock);
mutex_init(&chip->open_mutex);
chip->card = card; chip->card = card;
chip->port = port; chip->port = port;
chip->irq = -1; chip->irq = -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment