ASoC: rsnd: fixup rsnd_dai_call() behavior for .stop/.quit
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thu, 22 Oct 2015 03:14:43 +0000 (03:14 +0000)
committerMark Brown <broonie@kernel.org>
Thu, 22 Oct 2015 12:30:01 +0000 (13:30 +0100)
Current rsnd_dai_call returns immediately if rsnd_mod_call return fail.
Thus, each callback-count can be unbalanced for example .init was OK,
start was OK, but, .stop was not OK. This case .quit should be called
but isn't called. And, rsnd_dai_stream_quit() also not be called.
rsnd_dai_call() should call all .stop/.quit eventhough it returns error.

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

index 5c6714481f59fc2df1dec2b5289e01c8b0dccb30..deed48ef28b832821010f7192961aaa9af4ba84b 100644 (file)
@@ -327,9 +327,7 @@ u32 rsnd_get_dalign(struct rsnd_mod *mod, struct rsnd_dai_stream *io)
                mod = (io)->mod[i];                             \
                if (!mod)                                       \
                        continue;                               \
-               ret = rsnd_mod_call(mod, io, fn, param);        \
-               if (ret < 0)                                    \
-                       break;                                  \
+               ret |= rsnd_mod_call(mod, io, fn, param);       \
        }                                                       \
        ret;                                                    \
 })
@@ -495,16 +493,10 @@ static int rsnd_soc_dai_trigger(struct snd_pcm_substream *substream, int cmd,
                break;
        case SNDRV_PCM_TRIGGER_STOP:
                ret = rsnd_dai_call(stop, io, priv);
-               if (ret < 0)
-                       goto dai_trigger_end;
 
-               ret = rsnd_dai_call(quit, io, priv);
-               if (ret < 0)
-                       goto dai_trigger_end;
+               ret |= rsnd_dai_call(quit, io, priv);
 
-               ret = rsnd_platform_call(priv, dai, stop, ssi_id);
-               if (ret < 0)
-                       goto dai_trigger_end;
+               ret |= rsnd_platform_call(priv, dai, stop, ssi_id);
 
                rsnd_dai_stream_quit(io);
                break;