ASoC: davinci-mcasp: Index ruledata in drvdata with substream->stream

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>
This commit is contained in:
Jyri Sarha 2015-03-27 11:47:51 +02:00 committed by Mark Brown
parent a75a053f1e
commit 7b3d165a28

View File

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