Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Liam Girdwood <lrg@slimlogic.co.uk>
To: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Cc: alsa-devel@alsa-project.org,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	patches@opensource.wolfsonmicro.com
Subject: Re: [PATCH] ASoC: Return -1 instead of -EINVAL to ensure consistency
Date: Wed, 22 Sep 2010 09:54:41 +0100	[thread overview]
Message-ID: <1285145681.3107.5.camel@odin> (raw)
In-Reply-To: <1285085047-31508-1-git-send-email-dp@opensource.wolfsonmicro.com>

On Tue, 2010-09-21 at 17:04 +0100, Dimitris Papastamos wrote:
> The code can't really cope with I/O errors, so it would be better
> to be consistent throughout all cache functions and return -1 instead
> of -EINVAL.
> 
> The return value of snd_soc_read(...) is mostly checked in the probe
> function and nowhere else.
> ---
>  sound/soc/soc-cache.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c
> index 28bf1ff..6702a3d 100644
> --- a/sound/soc/soc-cache.c
> +++ b/sound/soc/soc-cache.c
> @@ -228,7 +228,7 @@ static unsigned int snd_soc_8_16_read(struct snd_soc_codec *codec,
>  	if (reg >= codec->driver->reg_cache_size ||
>  	    snd_soc_codec_volatile_register(codec, reg)) {
>  		if (codec->cache_only)
> -			return -EINVAL;
> +			return -1;
>  
>  		return codec->hw_read(codec, reg);
>  	} else {
> @@ -455,7 +455,7 @@ static unsigned int snd_soc_16_16_read(struct snd_soc_codec *codec,
>  	if (reg >= codec->driver->reg_cache_size ||
>  	    snd_soc_codec_volatile_register(codec, reg)) {
>  		if (codec->cache_only)
> -			return -EINVAL;
> +			return -1;
>  
>  		return codec->hw_read(codec, reg);
>  	}

Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

  reply	other threads:[~2010-09-22  8:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-21 16:04 [PATCH] ASoC: Return -1 instead of -EINVAL to ensure consistency Dimitris Papastamos
2010-09-22  8:54 ` Liam Girdwood [this message]
2010-09-22 15:49 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1285145681.3107.5.camel@odin \
    --to=lrg@slimlogic.co.uk \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=dp@opensource.wolfsonmicro.com \
    --cc=patches@opensource.wolfsonmicro.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox