From 90ffc1ecc500c04bf43a45d804bb151505c0d6a6 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Fri, 20 Jan 2017 04:23:29 +0000 Subject: ASoC: rsnd: fixup for_each_rsnd_mod_array{s} iterator increment commit 5f222a292 ("ASoC: rsnd: use for_each_rsnd_mod_xxx() ...") modifies rsnd_dai_call() to use for_each_rsnd_mod_arrays(). Current rsnd is incrementing iterator in rsnd_mod_next(), but the iterator will indicate +1 position in for_each loop in this case. Incremental position should be inside for() Reported-by: Hoan Nguyen An Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- sound/soc/sh/rcar/core.c | 2 -- sound/soc/sh/rcar/rsnd.h | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 4bd68de76130..948c5ec87980 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -363,8 +363,6 @@ struct rsnd_mod *rsnd_mod_next(int *iterator, if (!mod) continue; - (*iterator)++; - return mod; } diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index b90df77662df..7410ec0174db 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -374,10 +374,10 @@ struct rsnd_mod *rsnd_mod_next(int *iterator, int array_size); #define for_each_rsnd_mod(iterator, pos, io) \ for (iterator = 0; \ - (pos = rsnd_mod_next(&iterator, io, NULL, 0));) + (pos = rsnd_mod_next(&iterator, io, NULL, 0)); iterator++) #define for_each_rsnd_mod_arrays(iterator, pos, io, array, size) \ for (iterator = 0; \ - (pos = rsnd_mod_next(&iterator, io, array, size));) + (pos = rsnd_mod_next(&iterator, io, array, size)); iterator++) #define for_each_rsnd_mod_array(iterator, pos, io, array) \ for_each_rsnd_mod_arrays(iterator, pos, io, array, ARRAY_SIZE(array)) -- cgit v1.2.3 From ef30da1c52c633a6eaa017ad0d075aaa809a6154 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Thu, 2 Feb 2017 05:01:05 +0000 Subject: ASoC: rsnd: fixup reset timing of sync convert_rate Sync convert rate settings should be availabled *after* Playing. Thus, src->sync should be reset first of init function. Otherwise, it will set remaining settings when it start playing. This patch fixes it. Thanks to Yokoyama-san Reported-by: Hiroyuki Yokoyama Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- sound/soc/sh/rcar/src.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index 3a8f65bd1bf9..42db48db09ba 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c @@ -390,6 +390,9 @@ static int rsnd_src_init(struct rsnd_mod *mod, { struct rsnd_src *src = rsnd_mod_to_src(mod); + /* reset sync convert_rate */ + src->sync.val = 0; + rsnd_mod_power_on(mod); rsnd_src_activation(mod); @@ -398,9 +401,6 @@ static int rsnd_src_init(struct rsnd_mod *mod, rsnd_src_status_clear(mod); - /* reset sync convert_rate */ - src->sync.val = 0; - return 0; } -- cgit v1.2.3