未验证 提交 7a2ccad5 编写于 作者: K Kuninori Morimoto 提交者: Mark Brown

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: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 6b490879
......@@ -1624,21 +1624,20 @@ static int soc_probe_link_components(struct snd_soc_card *card,
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) {
ret = dai->driver->probe(dai);
int ret = dai->driver->probe(dai);
if (ret < 0) {
dev_err(dai->dev,
"ASoC: failed to probe DAI %s: %d\n",
dev_err(dai->dev, "ASoC: failed to probe DAI %s: %d\n",
dai->name, ret);
return ret;
}
}
dai->probed = 1;
}
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册