Skip to content

Commit

Permalink
ASoC: soc-core: avoid nested code on soc_remove_dai()
Browse files Browse the repository at this point in the history
Nested code is not readable.
This patch avoid it on soc_remove_dai().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Kuninori Morimoto authored and Mark Brown committed Sep 11, 2018
1 parent a6ebf4c commit 2eda3cb
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -942,17 +942,18 @@ static void soc_remove_dai(struct snd_soc_dai *dai, int order)
{
int err;

if (dai && dai->probed &&
dai->driver->remove_order == order) {
if (dai->driver->remove) {
err = dai->driver->remove(dai);
if (err < 0)
dev_err(dai->dev,
"ASoC: failed to remove %s: %d\n",
dai->name, err);
}
dai->probed = 0;
if (!dai || !dai->probed ||
dai->driver->remove_order != order)
return;

if (dai->driver->remove) {
err = dai->driver->remove(dai);
if (err < 0)
dev_err(dai->dev,
"ASoC: failed to remove %s: %d\n",
dai->name, err);
}
dai->probed = 0;
}

static void soc_remove_link_dais(struct snd_soc_card *card,
Expand Down

0 comments on commit 2eda3cb

Please sign in to comment.