diff options
author | Mark Brown <broonie@kernel.org> | 2018-12-13 14:36:46 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-12-13 14:36:46 +0000 |
commit | 8fe8915b6c0b5298fa547be21957b3860c39c46e (patch) | |
tree | f16772eef6506fa40fe43f53b416cd4cd4eccf6b /sound/soc/sh/rcar/core.c | |
parent | 1b46ed96961db1a826b3e5cadac18c7c4857f054 (diff) | |
parent | a01b8d1d24451bfc00d3a975d107f9b1590bf826 (diff) |
Merge branch 'for-4.20' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-4.21 intel dep
Diffstat (limited to 'sound/soc/sh/rcar/core.c')
-rw-r--r-- | sound/soc/sh/rcar/core.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index ad6298330fdb..59e250cc2e9d 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -1525,6 +1525,18 @@ int rsnd_kctrl_new(struct rsnd_mod *mod, }; int ret; + /* + * 1) Avoid duplicate register (ex. MIXer case) + * 2) re-register if card was rebinded + */ + list_for_each_entry(kctrl, &card->controls, list) { + struct rsnd_kctrl_cfg *c = kctrl->private_data; + + if (strcmp(kctrl->id.name, name) == 0 && + c->mod == mod) + return 0; + } + if (size > RSND_MAX_CHANNELS) return -EINVAL; |