OMAP: ASoC: Fix spinlock misuse in omap-pcm.c

omap_pcm_trigger is called also in interrupt context so CPU flags must
be restored when returning.

Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Acked-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

authored by Eero Nurkkala and committed by Mark Brown 21dff434 ef390c0b

+3 -2
+3 -2
sound/soc/omap/omap-pcm.c
··· 175 { 176 struct snd_pcm_runtime *runtime = substream->runtime; 177 struct omap_runtime_data *prtd = runtime->private_data; 178 int ret = 0; 179 180 - spin_lock_irq(&prtd->lock); 181 switch (cmd) { 182 case SNDRV_PCM_TRIGGER_START: 183 case SNDRV_PCM_TRIGGER_RESUME: ··· 196 default: 197 ret = -EINVAL; 198 } 199 - spin_unlock_irq(&prtd->lock); 200 201 return ret; 202 }
··· 175 { 176 struct snd_pcm_runtime *runtime = substream->runtime; 177 struct omap_runtime_data *prtd = runtime->private_data; 178 + unsigned long flags; 179 int ret = 0; 180 181 + spin_lock_irqsave(&prtd->lock, flags); 182 switch (cmd) { 183 case SNDRV_PCM_TRIGGER_START: 184 case SNDRV_PCM_TRIGGER_RESUME: ··· 195 default: 196 ret = -EINVAL; 197 } 198 + spin_unlock_irqrestore(&prtd->lock, flags); 199 200 return ret; 201 }