]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: Consolidate snd_soc_register_dai() and snd_soc_register_dais()
authorLars-Peter Clausen <lars@metafoo.de>
Sun, 9 Mar 2014 16:41:45 +0000 (17:41 +0100)
committerMark Brown <broonie@linaro.org>
Mon, 10 Mar 2014 12:17:53 +0000 (12:17 +0000)
commitc61ee83175c9fb0293d3a5b742d39484e0216d32
treefbce3db1fc890f4572be27d03b4e604eda908225
parente9ff399bb1a7660c00e421a98b2718ac3d20efb7
ASoC: Consolidate snd_soc_register_dai() and snd_soc_register_dais()

snd_soc_register_dais() has basically the same code as snd_soc_register_dai(),
but running in a loop. The only difference is that snd_soc_register_dai() calls
fmt_single_name() to generate the DAIs name and snd_soc_register_dais() calls
fmt_multiple_name(). This patch pushes the check in __snd_soc_register_component()
which decides whether to call snd_soc_register_dai() or snd_soc_register_dais()
to snd_soc_register_dais() to decide which naming scheme to use. This allows us
to remove snd_soc_register_dai().

The patch also updates snd_soc_register_dais() to unregister every DAI it finds
for the component rather than trying to unregister one DAI for each DAI that was
registered. Both have the same result since there won't be more DAIs than what
have been registered, but the former is easier to implement.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/soc-core.c