ASoC: cs4271: Fix a typo in the CS4171_NR_RATIOS

This should be CS4271_NR_RATIOS.
Fix it and use it.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/20190724060023.31302-1-christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Christophe JAILLET 2019-07-24 08:00:23 +02:00 committed by Mark Brown
parent 22581e7c51
commit 0c03e37af4
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -334,7 +334,7 @@ static struct cs4271_clk_cfg cs4271_clk_tab[] = {
{0, CS4271_MODE1_MODE_4X, 256, CS4271_MODE1_DIV_2}, {0, CS4271_MODE1_MODE_4X, 256, CS4271_MODE1_DIV_2},
}; };
#define CS4171_NR_RATIOS ARRAY_SIZE(cs4271_clk_tab) #define CS4271_NR_RATIOS ARRAY_SIZE(cs4271_clk_tab)
static int cs4271_hw_params(struct snd_pcm_substream *substream, static int cs4271_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params, struct snd_pcm_hw_params *params,
@ -383,13 +383,13 @@ static int cs4271_hw_params(struct snd_pcm_substream *substream,
val = CS4271_MODE1_MODE_4X; val = CS4271_MODE1_MODE_4X;
ratio = cs4271->mclk / cs4271->rate; ratio = cs4271->mclk / cs4271->rate;
for (i = 0; i < CS4171_NR_RATIOS; i++) for (i = 0; i < CS4271_NR_RATIOS; i++)
if ((cs4271_clk_tab[i].master == cs4271->master) && if ((cs4271_clk_tab[i].master == cs4271->master) &&
(cs4271_clk_tab[i].speed_mode == val) && (cs4271_clk_tab[i].speed_mode == val) &&
(cs4271_clk_tab[i].ratio == ratio)) (cs4271_clk_tab[i].ratio == ratio))
break; break;
if (i == CS4171_NR_RATIOS) { if (i == CS4271_NR_RATIOS) {
dev_err(component->dev, "Invalid sample rate\n"); dev_err(component->dev, "Invalid sample rate\n");
return -EINVAL; return -EINVAL;
} }