Commit da620d72 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

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: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 919567d9
...@@ -839,12 +839,14 @@ static int __rsnd_kctrl_new(struct rsnd_mod *mod, ...@@ -839,12 +839,14 @@ static int __rsnd_kctrl_new(struct rsnd_mod *mod,
struct rsnd_kctrl_cfg *cfg, struct rsnd_kctrl_cfg *cfg,
void (*update)(struct rsnd_mod *mod)) void (*update)(struct rsnd_mod *mod))
{ {
struct snd_soc_card *soc_card = rtd->card;
struct snd_card *card = rtd->card->snd_card; struct snd_card *card = rtd->card->snd_card;
struct snd_kcontrol *kctrl; struct snd_kcontrol *kctrl;
struct snd_kcontrol_new knew = { struct snd_kcontrol_new knew = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = name, .name = name,
.info = rsnd_kctrl_info, .info = rsnd_kctrl_info,
.index = rtd - soc_card->rtd,
.get = rsnd_kctrl_get, .get = rsnd_kctrl_get,
.put = rsnd_kctrl_put, .put = rsnd_kctrl_put,
.private_value = (unsigned long)cfg, .private_value = (unsigned long)cfg,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment