diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-07-01 22:13:46 +0200 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-07-02 21:24:07 +0100 |
commit | 48f466d112c9ca735ee765d8f5148d07a8c7bb1d (patch) | |
tree | 6a2bb9238d2135d40719df44ea686da1a1fee299 /sound/soc/soc-core.c | |
parent | b8257be5fff447681af8c8b72f1380e8a9c04286 (diff) | |
download | lwn-48f466d112c9ca735ee765d8f5148d07a8c7bb1d.tar.gz lwn-48f466d112c9ca735ee765d8f5148d07a8c7bb1d.zip |
ASoC: core: Replace soc_find_matching_codec() with soc_find_codec()
soc_find_matching_codec() works in the same way as soc_find_codec() except that
it only works for auxdevs. It can easily be replaced by the generic
soc_find_codec().
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r-- | sound/soc/soc-core.c | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 0cd36b781f4d..c8bdac2db377 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1649,32 +1649,13 @@ static void soc_unregister_ac97_dai_link(struct snd_soc_pcm_runtime *rtd) } #endif -static struct snd_soc_codec *soc_find_matching_codec(struct snd_soc_card *card, - int num) -{ - struct snd_soc_aux_dev *aux_dev = &card->aux_dev[num]; - struct snd_soc_codec *codec; - - /* find CODEC from registered CODECs */ - list_for_each_entry(codec, &codec_list, list) { - if (aux_dev->codec_of_node && - (codec->dev->of_node != aux_dev->codec_of_node)) - continue; - if (aux_dev->codec_name && - strcmp(codec->component.name, aux_dev->codec_name)) - continue; - return codec; - } - - return NULL; -} - static int soc_check_aux_dev(struct snd_soc_card *card, int num) { struct snd_soc_aux_dev *aux_dev = &card->aux_dev[num]; const char *codecname = aux_dev->codec_name; - struct snd_soc_codec *codec = soc_find_matching_codec(card, num); + struct snd_soc_codec *codec; + codec = soc_find_codec(aux_dev->codec_of_node, aux_dev->codec_name); if (codec) return 0; if (aux_dev->codec_of_node) @@ -1689,8 +1670,9 @@ static int soc_probe_aux_dev(struct snd_soc_card *card, int num) struct snd_soc_aux_dev *aux_dev = &card->aux_dev[num]; const char *codecname = aux_dev->codec_name; int ret = -ENODEV; - struct snd_soc_codec *codec = soc_find_matching_codec(card, num); + struct snd_soc_codec *codec; + codec = soc_find_codec(aux_dev->codec_of_node, aux_dev->codec_name); if (!codec) { if (aux_dev->codec_of_node) codecname = of_node_full_name(aux_dev->codec_of_node); |