]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ASoC: rsnd: need to call nolock_stop if nolock_start was failed
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Wed, 17 May 2017 07:59:20 +0000 (07:59 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 17 May 2017 09:28:30 +0000 (10:28 +0100)
rsnd_dai_call() is counting the called number of start/stop functions.
nolock_stop should be called if nolock_start was failed.
Otherwise, nolock_start doesn't called in 2nd play.
This patch solved this issue.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reported-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sh/rcar/core.c

index 1744015408c38f2ad530fbcbae9a22027f5f0828..3c47af1990cb2704d1025551ed7e408fbbb34b2e 100644 (file)
@@ -715,11 +715,16 @@ static int rsnd_soc_dai_startup(struct snd_pcm_substream *substream,
 {
        struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
        struct rsnd_dai_stream *io = rsnd_rdai_to_io(rdai, substream);
+       int ret;
 
        /*
         * call rsnd_dai_call without spinlock
         */
-       return rsnd_dai_call(nolock_start, io, priv);
+       ret = rsnd_dai_call(nolock_start, io, priv);
+       if (ret < 0)
+               rsnd_dai_call(nolock_stop, io, priv);
+
+       return ret;
 }
 
 static void rsnd_soc_dai_shutdown(struct snd_pcm_substream *substream,