From: Jonathan Cameron <jic23@kernel.org>
To: Hartmut Knaack <knaack.h@gmx.de>,
Vlad Dogaru <vlad.dogaru@intel.com>,
linux-iio@vger.kernel.org
Subject: Re: [PATCH 1/2] iio: sx9500: rework error handling of raw readings
Date: Sun, 05 Jul 2015 14:02:58 +0100 [thread overview]
Message-ID: <55992B02.2050305@kernel.org> (raw)
In-Reply-To: <559433F7.1080301@gmx.de>
On 01/07/15 19:39, Hartmut Knaack wrote:
> 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>
Applied to the fixes-for-4.2 branch of iio.git
Thanks,
Jonathan
>> ---
>> 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:
>>
>
next prev parent reply other threads:[~2015-07-05 13:03 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
2015-07-05 13:02 ` Jonathan Cameron [this message]
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=55992B02.2050305@kernel.org \
--to=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).