[ALSA] pcsp: locking fix
authorStas Sergeev <stsp@aknet.ru>
Wed, 12 Mar 2008 12:12:15 +0000 (13:12 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 24 Apr 2008 10:00:24 +0000 (12:00 +0200)
pcsp: locking fix.

Signed-off-by: Stas Sergeev <stsp@aknet.ru>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/drivers/pcsp/pcsp.c
sound/drivers/pcsp/pcsp_lib.c

index 547005cb0942bd52cb0dce3f362ea4658ce3230b..ac57e87d01bcf665790df09e5a020fd359bfa0c1 100644 (file)
@@ -191,11 +191,10 @@ static int __devexit pcsp_remove(struct platform_device *dev)
 
 static void pcsp_stop_beep(struct snd_pcsp *chip)
 {
-       unsigned long flags;
-       spin_lock_irqsave(&chip->substream_lock, flags);
+       spin_lock_irq(&chip->substream_lock);
        if (!chip->playback_substream)
                pcspkr_stop_sound();
-       spin_unlock_irqrestore(&chip->substream_lock, flags);
+       spin_unlock_irq(&chip->substream_lock);
 }
 
 static int pcsp_suspend(struct platform_device *dev, pm_message_t state)
index a302756eac7caaf301f4e99fa9fa02a5d0920e15..54253e9b4b02882cad3fd1a812363d5c47b98302 100644 (file)
@@ -305,7 +305,9 @@ static int snd_pcsp_playback_open(struct snd_pcm_substream *substream)
                return -EBUSY;
        }
        runtime->hw = snd_pcsp_playback;
+       spin_lock_irq(&chip->substream_lock);
        chip->playback_substream = substream;
+       spin_unlock_irq(&chip->substream_lock);
        return 0;
 }