]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ASoC: s3c24xx_simtec: Use static DAI format setup
authorLars-Peter Clausen <lars@metafoo.de>
Thu, 1 Jan 2015 16:16:24 +0000 (17:16 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 6 Jan 2015 17:34:30 +0000 (17:34 +0000)
Set the dai_fmt field in the dai_link struct instead of manually calling
snd_soc_dai_fmt(). This makes the code cleaner and shorter.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/samsung/s3c24xx_simtec.c

index 2c015f62ead603564683c1920ec3613ad5df7768..dcc008d1e1ab1bd896665b2c1cec40c73e497199 100644 (file)
@@ -169,24 +169,6 @@ static int simtec_hw_params(struct snd_pcm_substream *substream,
        struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
        int ret;
 
-       /* Set the CODEC as the bus clock master, I2S */
-       ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S |
-                                 SND_SOC_DAIFMT_NB_NF |
-                                 SND_SOC_DAIFMT_CBM_CFM);
-       if (ret) {
-               pr_err("%s: failed set cpu dai format\n", __func__);
-               return ret;
-       }
-
-       /* Set the CODEC as the bus clock master */
-       ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
-                                 SND_SOC_DAIFMT_NB_NF |
-                                 SND_SOC_DAIFMT_CBM_CFM);
-       if (ret) {
-               pr_err("%s: failed set codec dai format\n", __func__);
-               return ret;
-       }
-
        ret = snd_soc_dai_set_sysclk(codec_dai, 0,
                                     CODEC_CLOCK, SND_SOC_CLOCK_IN);
        if (ret) {
@@ -320,6 +302,8 @@ int simtec_audio_core_probe(struct platform_device *pdev,
        int ret;
 
        card->dai_link->ops = &simtec_snd_ops;
+       card->dai_link->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
+                                 SND_SOC_DAIFMT_CBM_CFM;
 
        pdata = pdev->dev.platform_data;
        if (!pdata) {