aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2016-12-06 21:05:22 -0500
committerMark Brown <broonie@kernel.org>2016-12-07 10:47:44 -0500
commit6bf66b1c35870e08359cb03c49a94e7fef529ef5 (patch)
tree028e2b30c8d6e61af5a60c9cbc85b44dd090036a
parent3ce2959d162a8f2d69a83582df619a20ff3f6645 (diff)
ASoC: rsnd: tidyup ssi->usrcnt counter check in hw_params
ssi->usrcnt will be updated on snd_soc_dai_ops::trigger, but snd_pcm_ops::hw_params will be called *before* it. Thus, ssi->usrcnt is still 0 when 1st call. rsnd_ssi_hw_params() needs to check its called count, this means trigger should be if (ssi->usrcnt) instead of if (ssi->usrcnt > 1). Reported-by: Nguyen Viet Dung <nv-dung@jinso.co.jp> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/sh/rcar/ssi.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
index e23e07b54d8c..411bda2387ad 100644
--- a/sound/soc/sh/rcar/ssi.c
+++ b/sound/soc/sh/rcar/ssi.c
@@ -417,11 +417,14 @@ static int rsnd_ssi_hw_params(struct rsnd_mod *mod,
417 int chan = params_channels(params); 417 int chan = params_channels(params);
418 418
419 /* 419 /*
420 * Already working. 420 * snd_pcm_ops::hw_params will be called *before*
421 * It will happen if SSI has parent/child connection. 421 * snd_soc_dai_ops::trigger. Thus, ssi->usrcnt is 0
422 * in 1st call.
422 */ 423 */
423 if (ssi->usrcnt > 1) { 424 if (ssi->usrcnt) {
424 /* 425 /*
426 * Already working.
427 * It will happen if SSI has parent/child connection.
425 * it is error if child <-> parent SSI uses 428 * it is error if child <-> parent SSI uses
426 * different channels. 429 * different channels.
427 */ 430 */