]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ASoC: davinci-mcasp: Index ruledata in drvdata with substream->stream
authorJyri Sarha <jsarha@ti.com>
Fri, 27 Mar 2015 09:47:51 +0000 (11:47 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 1 Apr 2015 20:34:15 +0000 (21:34 +0100)
The serializer direction definitions runs from 1 to 2, which does not
suite the purpose. The substream->stream is perfect for the purpose
and should have been used from the beginning.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/davinci/davinci-mcasp.c

index 76156d18ed4640aba1dd25b41ed5b996e6d5f9fd..0b6b1b286201d6414df28a6782d7b39a1ff0868b 100644 (file)
@@ -1149,7 +1149,7 @@ static int davinci_mcasp_startup(struct snd_pcm_substream *substream,
                if (mcasp->serial_dir[i] == dir)
                        max_channels++;
        }
-       mcasp->ruledata[dir].serializers = max_channels;
+       mcasp->ruledata[substream->stream].serializers = max_channels;
        max_channels *= mcasp->tdm_slots;
        /*
         * If the already active stream has less channels than the calculated
@@ -1172,7 +1172,7 @@ static int davinci_mcasp_startup(struct snd_pcm_substream *substream,
        if (mcasp->bclk_master && mcasp->bclk_div == 0 && mcasp->sysclk_freq) {
                int ret;
 
-               mcasp->ruledata[dir].mcasp = mcasp;
+               mcasp->ruledata[substream->stream].mcasp = mcasp;
 
                ret = snd_pcm_hw_rule_add(substream->runtime, 0,
                                          SNDRV_PCM_HW_PARAM_RATE,