[alsa-devel] [PATCH] ASoC: cs4271.c: adapt to error handling introduced in snd_soc_update_bits()
Mark Brown
broonie at opensource.wolfsonmicro.com
Fri Jan 21 19:29:55 CET 2011
On Fri, Jan 21, 2011 at 09:27:29PM +0300, Alexander wrote:
> - return snd_soc_update_bits(codec, CS4271_DACCTL,
> - CS4271_DACCTL_DEM_MASK, val);
> + i = snd_soc_update_bits(codec, CS4271_DACCTL, CS4271_DACCTL_DEM_MASK, val);
> + if (i < 0)
> + return i;
> + return 0;
It'd seem a bit more tasteful to declare a 'ret' variable rather than
reusing i as you do here and in another hunk.
> static int cs4271_soc_resume(struct snd_soc_codec *codec)
> {
> + int ret;
> /* Restore codec state */
> - snd_soc_cache_sync(codec);
> + ret = snd_soc_cache_sync(codec);
> + if (ret < 0)
> + return ret;
This isn't connected to snd_soc_update_bits()....
More information about the Alsa-devel
mailing list