From 1bc1f30565b561bafc51725fce336aec59029437 Mon Sep 17 00:00:00 2001 From: Stas Sergeev Date: Wed, 12 Mar 2008 13:12:15 +0100 Subject: [ALSA] pcsp: locking fix pcsp: locking fix. Signed-off-by: Stas Sergeev Signed-off-by: Takashi Iwai --- sound/drivers/pcsp/pcsp.c | 5 ++--- sound/drivers/pcsp/pcsp_lib.c | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sound/drivers/pcsp/pcsp.c b/sound/drivers/pcsp/pcsp.c index 547005cb094..ac57e87d01b 100644 --- a/sound/drivers/pcsp/pcsp.c +++ b/sound/drivers/pcsp/pcsp.c @@ -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) diff --git a/sound/drivers/pcsp/pcsp_lib.c b/sound/drivers/pcsp/pcsp_lib.c index a302756eac7..54253e9b4b0 100644 --- a/sound/drivers/pcsp/pcsp_lib.c +++ b/sound/drivers/pcsp/pcsp_lib.c @@ -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; } -- cgit v1.2.3-70-g09d2