All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hartmut Knaack <knaack.h@gmx.de>
To: Vlad Dogaru <vlad.dogaru@intel.com>,
	linux-iio@vger.kernel.org, jic23@kernel.org
Subject: Re: [PATCH 1/2] iio: sx9500: rework error handling of raw readings
Date: Wed, 01 Jul 2015 20:39:51 +0200	[thread overview]
Message-ID: <559433F7.1080301@gmx.de> (raw)
In-Reply-To: <1435663259-21998-2-git-send-email-vlad.dogaru@intel.com>

Vlad Dogaru schrieb am 30.06.2015 um 13:20:
> Fix error handling so that we can power the chip down even if a raw read
> fails.
> 
> Reported-by: Hartmut Knaack <knaack.h@gmx.de>
> Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
Acked-by: Hartmut Knaack <knaack.h@gmx.de>
> ---
>  drivers/iio/proximity/sx9500.c | 16 +++++++++-------
>  1 file changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/iio/proximity/sx9500.c b/drivers/iio/proximity/sx9500.c
> index 2042e37..ba1cbbe 100644
> --- a/drivers/iio/proximity/sx9500.c
> +++ b/drivers/iio/proximity/sx9500.c
> @@ -329,27 +329,29 @@ static int sx9500_read_proximity(struct sx9500_data *data,
>  	else
>  		ret = sx9500_wait_for_sample(data);
>  
> -	if (ret < 0)
> -		return ret;
> -
>  	mutex_lock(&data->mutex);
>  
> -	ret = sx9500_read_prox_data(data, chan, val);
>  	if (ret < 0)
> -		goto out;
> +		goto out_dec_data_rdy;
>  
> -	ret = sx9500_dec_chan_users(data, chan->channel);
> +	ret = sx9500_read_prox_data(data, chan, val);
>  	if (ret < 0)
> -		goto out;
> +		goto out_dec_data_rdy;
>  
>  	ret = sx9500_dec_data_rdy_users(data);
>  	if (ret < 0)
> +		goto out_dec_chan;
> +
> +	ret = sx9500_dec_chan_users(data, chan->channel);
> +	if (ret < 0)
>  		goto out;
>  
>  	ret = IIO_VAL_INT;
>  
>  	goto out;
>  
> +out_dec_data_rdy:
> +	sx9500_dec_data_rdy_users(data);
>  out_dec_chan:
>  	sx9500_dec_chan_users(data, chan->channel);
>  out:
> 

  reply	other threads:[~2015-07-01 18:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-30 11:20 [PATCH 0/2] iio: sx9500: couple of bug fixes Vlad Dogaru
2015-06-30 11:20 ` [PATCH 1/2] iio: sx9500: rework error handling of raw readings Vlad Dogaru
2015-07-01 18:39   ` Hartmut Knaack [this message]
2015-07-05 13:02     ` Jonathan Cameron
2015-06-30 11:20 ` [PATCH 2/2] iio: sx9500: fix bug in compensation code Vlad Dogaru
2015-07-01 18:42   ` Hartmut Knaack
2015-07-05 13:04     ` Jonathan Cameron

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=559433F7.1080301@gmx.de \
    --to=knaack.h@gmx.de \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=vlad.dogaru@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.