Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: core: allow a dt node to provide several components

At the moment, querying the dai_name will stop of the first component
matching the dt node. This does not allow a device (single dt node) to
provide several ASoC components which could then be used through DT.

This change let the search go on if the xlate function of the component
returns an error, giving the possibility to another component to match
and return the dai_name.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20200213155159.3235792-2-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Jerome Brunet and committed by
Mark Brown
1dfa5a5a 0c48a653

+8
+8
sound/soc/soc-core.c
··· 3102 3102 *dai_name = dai->driver->name; 3103 3103 if (!*dai_name) 3104 3104 *dai_name = pos->name; 3105 + } else if (ret) { 3106 + /* 3107 + * if another error than ENOTSUPP is returned go on and 3108 + * check if another component is provided with the same 3109 + * node. This may happen if a device provides several 3110 + * components 3111 + */ 3112 + continue; 3105 3113 } 3106 3114 3107 3115 break;