summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/mc13783.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/mc13783.c')
-rw-r--r--sound/soc/codecs/mc13783.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sound/soc/codecs/mc13783.c b/sound/soc/codecs/mc13783.c
index 5402dfbbb716..30ca4b6b396a 100644
--- a/sound/soc/codecs/mc13783.c
+++ b/sound/soc/codecs/mc13783.c
@@ -188,10 +188,16 @@ static int mc13783_pcm_hw_params_sync(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
- return mc13783_pcm_hw_params_dac(substream, params, dai);
- else
- return mc13783_pcm_hw_params_codec(substream, params, dai);
+ int ret = 0;
+
+ ret = mc13783_pcm_hw_params_dac(substream, params, dai);
+ if (ret)
+ return ret;
+
+ if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
+ ret = mc13783_pcm_hw_params_codec(substream, params, dai);
+
+ return ret;
}
static int mc13783_set_fmt(struct snd_soc_dai *dai, unsigned int fmt,