diff options
author | Stas Sergeev <stsp@aknet.ru> | 2008-03-12 08:12:15 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-04-24 06:00:24 -0400 |
commit | 1bc1f30565b561bafc51725fce336aec59029437 (patch) | |
tree | 2bde6214d669f84dc0ae73b1d1b1259090190f41 /sound/drivers/pcsp | |
parent | bb9f76cd5909b9da6b4d31b55a4086cc35614fe0 (diff) |
[ALSA] pcsp: locking fix
pcsp: locking fix.
Signed-off-by: Stas Sergeev <stsp@aknet.ru>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/drivers/pcsp')
-rw-r--r-- | sound/drivers/pcsp/pcsp.c | 5 | ||||
-rw-r--r-- | 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 547005cb0942..ac57e87d01bc 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) | |||
191 | 191 | ||
192 | static void pcsp_stop_beep(struct snd_pcsp *chip) | 192 | static void pcsp_stop_beep(struct snd_pcsp *chip) |
193 | { | 193 | { |
194 | unsigned long flags; | 194 | spin_lock_irq(&chip->substream_lock); |
195 | spin_lock_irqsave(&chip->substream_lock, flags); | ||
196 | if (!chip->playback_substream) | 195 | if (!chip->playback_substream) |
197 | pcspkr_stop_sound(); | 196 | pcspkr_stop_sound(); |
198 | spin_unlock_irqrestore(&chip->substream_lock, flags); | 197 | spin_unlock_irq(&chip->substream_lock); |
199 | } | 198 | } |
200 | 199 | ||
201 | static int pcsp_suspend(struct platform_device *dev, pm_message_t state) | 200 | 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 a302756eac7c..54253e9b4b02 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) | |||
305 | return -EBUSY; | 305 | return -EBUSY; |
306 | } | 306 | } |
307 | runtime->hw = snd_pcsp_playback; | 307 | runtime->hw = snd_pcsp_playback; |
308 | spin_lock_irq(&chip->substream_lock); | ||
308 | chip->playback_substream = substream; | 309 | chip->playback_substream = substream; |
310 | spin_unlock_irq(&chip->substream_lock); | ||
309 | return 0; | 311 | return 0; |
310 | } | 312 | } |
311 | 313 | ||