summaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-03-08 01:11:15 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-03-08 19:56:26 +0100
commit4f333b20aef4459a24590fa8545e974f8f137f62 (patch)
tree1ccb5509f14e239c15fb05c3c2efe8ede5f3eead /sound/soc
parentASoC: Convert WM9081 SYSCLK configuration to be device wide (diff)
downloadlinux-4f333b20aef4459a24590fa8545e974f8f137f62.tar.xz
linux-4f333b20aef4459a24590fa8545e974f8f137f62.zip
ASoC: Refactor symmetric_rates check to reduce indentation
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/soc-core.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index c2ec6cb05631..65ff61211a85 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -500,20 +500,20 @@ static int soc_pcm_apply_symmetry(struct snd_pcm_substream *substream)
struct snd_soc_dai *codec_dai = rtd->codec_dai;
int ret;
- if (codec_dai->driver->symmetric_rates || cpu_dai->driver->symmetric_rates ||
- rtd->dai_link->symmetric_rates) {
- dev_dbg(&rtd->dev, "Symmetry forces %dHz rate\n",
- rtd->rate);
-
- ret = snd_pcm_hw_constraint_minmax(substream->runtime,
- SNDRV_PCM_HW_PARAM_RATE,
- rtd->rate,
- rtd->rate);
- if (ret < 0) {
- dev_err(&rtd->dev,
- "Unable to apply rate symmetry constraint: %d\n", ret);
- return ret;
- }
+ if (!codec_dai->driver->symmetric_rates &&
+ !cpu_dai->driver->symmetric_rates &&
+ !rtd->dai_link->symmetric_rates)
+ return 0;
+
+ dev_dbg(&rtd->dev, "Symmetry forces %dHz rate\n", rtd->rate);
+
+ ret = snd_pcm_hw_constraint_minmax(substream->runtime,
+ SNDRV_PCM_HW_PARAM_RATE,
+ rtd->rate, rtd->rate);
+ if (ret < 0) {
+ dev_err(&rtd->dev,
+ "Unable to apply rate symmetry constraint: %d\n", ret);
+ return ret;
}
return 0;