Skip to content

Commit e974777

Browse files
morimotogregkh
authored andcommitted
ASoC: rsnd: avoid pointless loop in rsnd_mod_interrupt()
commit 2daf71ad8da6cb57f919c9c876ee7e42530371df upstream. Current Renesas sound driver doesn't have 1:1 relationship between stream <-> mod because it is supporting MIX. Because of this reason rsnd_mod_interrupt() is searching correspond mod by for loop. But this loop is not needed, because each mod has own type. This patch avoid pointless loop by using mod->type. This patch is good for SSI-parent support, because stream might have 2 SSI as SSI-parent/child. SSI interrupt handler will be called twice if stream has SSI-parent without this patch. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Thong Ho <thong.ho.px@rvc.renesas.com> Signed-off-by: Nhan Nguyen <nhan.nguyen.yb@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent fdc568a commit e974777

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

sound/soc/sh/rcar/core.c

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -192,19 +192,16 @@ void rsnd_mod_interrupt(struct rsnd_mod *mod,
192192
struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
193193
struct rsnd_dai_stream *io;
194194
struct rsnd_dai *rdai;
195-
int i, j;
196-
197-
for_each_rsnd_dai(rdai, priv, j) {
195+
int i;
198196

199-
for (i = 0; i < RSND_MOD_MAX; i++) {
200-
io = &rdai->playback;
201-
if (mod == io->mod[i])
202-
callback(mod, io);
197+
for_each_rsnd_dai(rdai, priv, i) {
198+
io = &rdai->playback;
199+
if (mod == io->mod[mod->type])
200+
callback(mod, io);
203201

204-
io = &rdai->capture;
205-
if (mod == io->mod[i])
206-
callback(mod, io);
207-
}
202+
io = &rdai->capture;
203+
if (mod == io->mod[mod->type])
204+
callback(mod, io);
208205
}
209206
}
210207

0 commit comments

Comments
 (0)