Skip to content

Commit da620d7

Browse files
morimotobroonie
authored andcommitted
ASoC: rsnd: care snd_kcontrol's index
rsnd might be used in multi-codec sound card. Then, same name kcontrol will be registered many times, and it will be error. This patch fixes this issue by using .index Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 919567d commit da620d7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sound/soc/sh/rcar/core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,12 +839,14 @@ static int __rsnd_kctrl_new(struct rsnd_mod *mod,
839839
struct rsnd_kctrl_cfg *cfg,
840840
void (*update)(struct rsnd_mod *mod))
841841
{
842+
struct snd_soc_card *soc_card = rtd->card;
842843
struct snd_card *card = rtd->card->snd_card;
843844
struct snd_kcontrol *kctrl;
844845
struct snd_kcontrol_new knew = {
845846
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
846847
.name = name,
847848
.info = rsnd_kctrl_info,
849+
.index = rtd - soc_card->rtd,
848850
.get = rsnd_kctrl_get,
849851
.put = rsnd_kctrl_put,
850852
.private_value = (unsigned long)cfg,

0 commit comments

Comments
 (0)