ASoC: soc-core: soc_probe_dai() code simplification
Current soc_probe_dai() is using deep nested condition. Thus, it is difficult to read/understand. This patch simplification it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
committed by
Mark Brown
parent
6b49087912
commit
7a2ccad581
@ -1624,22 +1624,21 @@ static int soc_probe_link_components(struct snd_soc_card *card,
|
|||||||
|
|
||||||
static int soc_probe_dai(struct snd_soc_dai *dai, int order)
|
static int soc_probe_dai(struct snd_soc_dai *dai, int order)
|
||||||
{
|
{
|
||||||
int ret;
|
if (dai->probed ||
|
||||||
|
dai->driver->probe_order != order)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (!dai->probed && dai->driver->probe_order == order) {
|
if (dai->driver->probe) {
|
||||||
if (dai->driver->probe) {
|
int ret = dai->driver->probe(dai);
|
||||||
ret = dai->driver->probe(dai);
|
if (ret < 0) {
|
||||||
if (ret < 0) {
|
dev_err(dai->dev, "ASoC: failed to probe DAI %s: %d\n",
|
||||||
dev_err(dai->dev,
|
dai->name, ret);
|
||||||
"ASoC: failed to probe DAI %s: %d\n",
|
return ret;
|
||||||
dai->name, ret);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dai->probed = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dai->probed = 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user