[ALSA] Fix rwlock around snd_iprintf() in sound core

Fixed rwlock around snd_iprintf() in sound core part.
Replaced with mutex.
Also, make mutex and flags static variables with addition of
snd_card_locked() function (just for sound.c).

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai
2006-05-15 19:49:05 +02:00
committed by Jaroslav Kysela
parent 0defb2672d
commit 746df94898
3 changed files with 33 additions and 28 deletions

View File

@@ -81,14 +81,9 @@ extern struct class *sound_class;
*/
void snd_request_card(int card)
{
int locked;
if (! current->fs->root)
return;
read_lock(&snd_card_rwlock);
locked = snd_cards_lock & (1 << card);
read_unlock(&snd_card_rwlock);
if (locked)
if (snd_card_locked(card))
return;
if (card < 0 || card >= cards_limit)
return;