Skip to content

Commit

Permalink
ASoC: simple-card: simplify code
Browse files Browse the repository at this point in the history
The check of the mandatory fields is done for DT in its specific sequence.
Move the global check to the non-DT sequence.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Jean-Francois Moine authored and Mark Brown committed Feb 3, 2014
1 parent 38dbfb5 commit 7722f83
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions sound/soc/generic/simple-card.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,16 +225,16 @@ static int asoc_simple_card_probe(struct platform_device *pdev)

memcpy(cinfo, dev->platform_data, sizeof(*cinfo));
cinfo->snd_card.dev = dev;
}

if (!cinfo->name ||
!cinfo->card ||
!cinfo->codec_dai.name ||
!(cinfo->codec || of_codec) ||
!(cinfo->platform || of_platform) ||
!(cinfo->cpu_dai.name || of_cpu)) {
dev_err(dev, "insufficient asoc_simple_card_info settings\n");
return -EINVAL;
if (!cinfo->name ||
!cinfo->card ||
!cinfo->codec_dai.name ||
!cinfo->codec ||
!cinfo->platform ||
!cinfo->cpu_dai.name) {
dev_err(dev, "insufficient asoc_simple_card_info settings\n");
return -EINVAL;
}
}

/*
Expand Down

0 comments on commit 7722f83

Please sign in to comment.