[alsa-devel] [PATCH] [v2] ASoC: cs4270: use the built-in register cache support

Timur Tabi timur at freescale.com
Mon Jan 10 19:33:30 CET 2011

Mark Brown wrote:
> It's supposed to be 1 for change, 0 for no change or an error - if you
> look at the core functions you'll see that they generally all follow
> this idiom of using the return value from snd_soc_update_bits() directly.

Ok, so that all works then.

I found another issue.  snd_soc_update_bits() breaks if snd_soc_read() returns a
negative number, so I'll fix that.  But why do the I/O functions in soc-cache.c
do this:

static unsigned int snd_soc_16_16_read(struct snd_soc_codec *codec,
				       unsigned int reg)
	ret = snd_soc_cache_read(codec, reg, &val);
	if (ret < 0)
		return -1;

What's wrong with:

	if (ret < 0)
		return ret;

Timur Tabi
Linux kernel developer at Freescale

More information about the Alsa-devel mailing list