ASoC: core: Add helpers for codec and codec_dai search
authorMisael Lopez Cruz <misael.lopez@ti.com>
Fri, 21 Mar 2014 15:27:25 +0000 (16:27 +0100)
committerMark Brown <broonie@linaro.org>
Mon, 14 Apr 2014 19:37:25 +0000 (20:37 +0100)
commit12023a9af8f6602e09d9276d3476f6861ca0f127
tree34a3289273aba7fdc6894221ac42432dd24a57a6
parentc9eaa447e77efe77b7fa4c953bd62de8297fd6c5
ASoC: core: Add helpers for codec and codec_dai search

Add dedicated helpers for codec and codec_dai search in preparation
for DAI-multicodec. It will help reducing the extra indentation
that will be introduced by the iteration over multiple codecs.

Previous implementation unnecessarily kept searching for a matching
codec in the remaining register codecs even if it was already found.

Fix that by returning in case of matching.

Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
[fparent@baylibre.com: Adapt to 3.14+]
Signed-off-by: Fabien Parent <fparent@baylibre.com>
Signed-off-by: Benoit Cousson <bcousson@baylibre.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/soc-core.c