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

ASoC: wm8350: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE

DECLARE_TLV_DB_RANGE() has the advantage over using TLV_DB_RANGE_HEAD()
that it automatically calculates the number of items in the TLV and is
hence less prone to manual error.

Generate using the following coccinelle script

// <smpl>
@@
declarer name DECLARE_TLV_DB_RANGE;
identifier tlv;
constant x;
@@
-unsigned int tlv[] = {
- TLV_DB_RANGE_HEAD(x),
+DECLARE_TLV_DB_RANGE(tlv,
...
-};
+);
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Lars-Peter Clausen and committed by
Mark Brown
d3d383ba 5ee0b8f8

+3 -4
+3 -4
sound/soc/codecs/wm8350.c
··· 394 394 static DECLARE_TLV_DB_SCALE(adc_pcm_tlv, -12700, 50, 1); 395 395 static DECLARE_TLV_DB_SCALE(out_mix_tlv, -1500, 300, 1); 396 396 397 - static const unsigned int capture_sd_tlv[] = { 398 - TLV_DB_RANGE_HEAD(2), 397 + static const DECLARE_TLV_DB_RANGE(capture_sd_tlv, 399 398 0, 12, TLV_DB_SCALE_ITEM(-3600, 300, 1), 400 - 13, 15, TLV_DB_SCALE_ITEM(0, 0, 0), 401 - }; 399 + 13, 15, TLV_DB_SCALE_ITEM(0, 0, 0) 400 + ); 402 401 403 402 static const struct snd_kcontrol_new wm8350_snd_controls[] = { 404 403 SOC_ENUM("Playback Deemphasis", wm8350_enum[0]),