Commit 1bc1f305 authored by Stas Sergeev's avatar Stas Sergeev Committed by Takashi Iwai

[ALSA] pcsp: locking fix

pcsp: locking fix.
Signed-off-by: default avatarStas Sergeev <stsp@aknet.ru>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent bb9f76cd
...@@ -191,11 +191,10 @@ static int __devexit pcsp_remove(struct platform_device *dev) ...@@ -191,11 +191,10 @@ static int __devexit pcsp_remove(struct platform_device *dev)
static void pcsp_stop_beep(struct snd_pcsp *chip) static void pcsp_stop_beep(struct snd_pcsp *chip)
{ {
unsigned long flags; spin_lock_irq(&chip->substream_lock);
spin_lock_irqsave(&chip->substream_lock, flags);
if (!chip->playback_substream) if (!chip->playback_substream)
pcspkr_stop_sound(); 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) static int pcsp_suspend(struct platform_device *dev, pm_message_t state)
......
...@@ -305,7 +305,9 @@ static int snd_pcsp_playback_open(struct snd_pcm_substream *substream) ...@@ -305,7 +305,9 @@ static int snd_pcsp_playback_open(struct snd_pcm_substream *substream)
return -EBUSY; return -EBUSY;
} }
runtime->hw = snd_pcsp_playback; runtime->hw = snd_pcsp_playback;
spin_lock_irq(&chip->substream_lock);
chip->playback_substream = substream; chip->playback_substream = substream;
spin_unlock_irq(&chip->substream_lock);
return 0; return 0;
} }
......
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