Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: twl4030: Use snd_pcm_hw_constraint_single()

Use the new snd_pcm_hw_constraint_single() helper function instead of
calling snd_pcm_hw_constraint_minmax() with the same value for min and max
to install a constraint that limits the possible configuration values to a
single value. Using snd_pcm_hw_constraint_single() makes the indented
result clearer and is slightly shorter.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Lars-Peter Clausen and committed by
Takashi Iwai
e795d831 153e2f5c

+5 -8
+5 -8
sound/soc/codecs/twl4030.c
··· 1612 1612 return; 1613 1613 1614 1614 /* Set the constraints according to the already configured stream */ 1615 - snd_pcm_hw_constraint_minmax(slv_substream->runtime, 1615 + snd_pcm_hw_constraint_single(slv_substream->runtime, 1616 1616 SNDRV_PCM_HW_PARAM_RATE, 1617 - twl4030->rate, 1618 1617 twl4030->rate); 1619 1618 1620 - snd_pcm_hw_constraint_minmax(slv_substream->runtime, 1619 + snd_pcm_hw_constraint_single(slv_substream->runtime, 1621 1620 SNDRV_PCM_HW_PARAM_SAMPLE_BITS, 1622 - twl4030->sample_bits, 1623 1621 twl4030->sample_bits); 1624 1622 1625 - snd_pcm_hw_constraint_minmax(slv_substream->runtime, 1623 + snd_pcm_hw_constraint_single(slv_substream->runtime, 1626 1624 SNDRV_PCM_HW_PARAM_CHANNELS, 1627 - twl4030->channels, 1628 1625 twl4030->channels); 1629 1626 } 1630 1627 ··· 1666 1669 /* In option2 4 channel is not supported, set the 1667 1670 * constraint for the first stream for channels, the 1668 1671 * second stream will 'inherit' this cosntraint */ 1669 - snd_pcm_hw_constraint_minmax(substream->runtime, 1672 + snd_pcm_hw_constraint_single(substream->runtime, 1670 1673 SNDRV_PCM_HW_PARAM_CHANNELS, 1671 - 2, 2); 1674 + 2); 1672 1675 } 1673 1676 twl4030->master_substream = substream; 1674 1677 }