ASoC: soc-core: tidyup soc_probe_aux_devices()
snd_soc_bind_card() is calling many initialize functions for each card / link / dai / aux etc, etc, etc... When error happen, the message is indicated at snd_soc_bind_card(), not at each functions. But, only soc_probe_aux_devices() case is indicating error at functions, not at snd_soc_bind_card(). It is not an issue, but unbalanced. This patch moves error message to snd_soc_bind_card(). Also avoids deep-nested code. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87lfsthkw9.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
ed90c013a7
commit
74bd3f92d0
@ -1579,21 +1579,18 @@ static int soc_bind_aux_dev(struct snd_soc_card *card)
|
|||||||
|
|
||||||
static int soc_probe_aux_devices(struct snd_soc_card *card)
|
static int soc_probe_aux_devices(struct snd_soc_card *card)
|
||||||
{
|
{
|
||||||
struct snd_soc_component *comp;
|
struct snd_soc_component *component;
|
||||||
int order;
|
int order;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
for_each_comp_order(order) {
|
for_each_comp_order(order) {
|
||||||
for_each_card_auxs(card, comp) {
|
for_each_card_auxs(card, component) {
|
||||||
if (comp->driver->probe_order == order) {
|
if (component->driver->probe_order != order)
|
||||||
ret = soc_probe_component(card, comp);
|
continue;
|
||||||
if (ret < 0) {
|
|
||||||
dev_err(card->dev,
|
ret = soc_probe_component(card, component);
|
||||||
"ASoC: failed to probe aux component %s %d\n",
|
if (ret < 0)
|
||||||
comp->name, ret);
|
return ret;
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2042,8 +2039,11 @@ static int snd_soc_bind_card(struct snd_soc_card *card)
|
|||||||
|
|
||||||
/* probe auxiliary components */
|
/* probe auxiliary components */
|
||||||
ret = soc_probe_aux_devices(card);
|
ret = soc_probe_aux_devices(card);
|
||||||
if (ret < 0)
|
if (ret < 0) {
|
||||||
|
dev_err(card->dev,
|
||||||
|
"ASoC: failed to probe aux component %d\n", ret);
|
||||||
goto probe_end;
|
goto probe_end;
|
||||||
|
}
|
||||||
|
|
||||||
/* probe all DAI links on this card */
|
/* probe all DAI links on this card */
|
||||||
ret = soc_probe_link_dais(card);
|
ret = soc_probe_link_dais(card);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user