diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2015-10-18 18:04:33 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-10-22 15:49:20 +0300 |
commit | 26d9ca3462df8f7e83fc372b23c8da5ed2b1c4f3 (patch) | |
tree | 6b05dea43a4c97116de5b5e0853abf38e9b24fee /sound/soc/soc-ops.c | |
parent | 6ff33f3902c3b1c5d0db6b1e2c70b6d76fba357f (diff) | |
download | linux-26d9ca3462df8f7e83fc372b23c8da5ed2b1c4f3.tar.xz |
ASoC: Let snd_soc_limit_volume() take a snd_soc_card
snd_soc_limit_volume() operates on a card and the CODEC that is passed in
is only used to look up the card. Let it directly take the card instead.
This makes it possible to use it when no snd_soc_codec is available.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-ops.c')
-rw-r--r-- | sound/soc/soc-ops.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c index 100d92b5b77e..20f702add3f8 100644 --- a/sound/soc/soc-ops.c +++ b/sound/soc/soc-ops.c @@ -560,16 +560,16 @@ EXPORT_SYMBOL_GPL(snd_soc_get_volsw_range); /** * snd_soc_limit_volume - Set new limit to an existing volume control. * - * @codec: where to look for the control + * @card: where to look for the control * @name: Name of the control * @max: new maximum limit * * Return 0 for success, else error. */ -int snd_soc_limit_volume(struct snd_soc_codec *codec, +int snd_soc_limit_volume(struct snd_soc_card *card, const char *name, int max) { - struct snd_card *card = codec->component.card->snd_card; + struct snd_card *snd_card = card->snd_card; struct snd_kcontrol *kctl; struct soc_mixer_control *mc; int found = 0; @@ -579,7 +579,7 @@ int snd_soc_limit_volume(struct snd_soc_codec *codec, if (unlikely(!name || max <= 0)) return -EINVAL; - list_for_each_entry(kctl, &card->controls, list) { + list_for_each_entry(kctl, &snd_card->controls, list) { if (!strncmp(kctl->id.name, name, sizeof(kctl->id.name))) { found = 1; break; |