linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Hartmut Knaack <knaack.h@gmx.de>,
	Daniel Baluta <daniel.baluta@intel.com>
Cc: lars@metafoo.de, pmeerw@pmeerw.net, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	srinivas.pandruvada@linux.intel.com
Subject: Re: [PATCH 02/10] iio: imu: kmx61: Don't ignore kmx61_set_power_state errors
Date: Sun, 04 Jan 2015 10:42:11 +0000	[thread overview]
Message-ID: <54A91903.3020800@kernel.org> (raw)
In-Reply-To: <54A54F91.3000403@gmx.de>

On 01/01/15 13:45, Hartmut Knaack wrote:
> Daniel Baluta schrieb am 23.12.2014 um 14:22:
>> ..except while in an error handler, where there is nothing
>> to be done anyway.
>>
>> Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de>
Applied
>> ---
>>  drivers/iio/imu/kmx61.c | 11 +++++++++--
>>  1 file changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/iio/imu/kmx61.c b/drivers/iio/imu/kmx61.c
>> index fe0cee7..e9cbd91 100644
>> --- a/drivers/iio/imu/kmx61.c
>> +++ b/drivers/iio/imu/kmx61.c
>> @@ -830,7 +830,12 @@ static int kmx61_read_raw(struct iio_dev *indio_dev,
>>  		}
>>  		mutex_lock(&data->lock);
>>  
>> -		kmx61_set_power_state(data, true, chan->address);
>> +		ret = kmx61_set_power_state(data, true, chan->address);
>> +		if (ret) {
>> +			mutex_unlock(&data->lock);
>> +			return ret;
>> +		}
>> +
>>  		ret = kmx61_read_measurement(data, base_reg, chan->scan_index);
>>  		if (ret < 0) {
>>  			kmx61_set_power_state(data, false, chan->address);
>> @@ -839,9 +844,11 @@ static int kmx61_read_raw(struct iio_dev *indio_dev,
>>  		}
>>  		*val = sign_extend32(ret >> chan->scan_type.shift,
>>  				     chan->scan_type.realbits - 1);
>> -		kmx61_set_power_state(data, false, chan->address);
>> +		ret = kmx61_set_power_state(data, false, chan->address);
>>  
>>  		mutex_unlock(&data->lock);
>> +		if (ret)
>> +			return ret;
>>  		return IIO_VAL_INT;
>>  	case IIO_CHAN_INFO_SCALE:
>>  		switch (chan->type) {
>>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


  reply	other threads:[~2015-01-04 10:42 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-23 13:22 [PATCH 00/10] iio: KMX61 fixes Daniel Baluta
2014-12-23 13:22 ` [PATCH 01/10] iio: imu: kmx61: Save odr_bits for later use Daniel Baluta
2015-01-01 13:45   ` Hartmut Knaack
2015-01-04 10:41     ` Jonathan Cameron
2014-12-23 13:22 ` [PATCH 02/10] iio: imu: kmx61: Don't ignore kmx61_set_power_state errors Daniel Baluta
2015-01-01 13:45   ` Hartmut Knaack
2015-01-04 10:42     ` Jonathan Cameron [this message]
2014-12-23 13:22 ` [PATCH 03/10] iio: imu: kmx61: Enhance error handling Daniel Baluta
2015-01-01 13:47   ` Hartmut Knaack
2015-01-04 10:45     ` Jonathan Cameron
2015-01-05  8:57       ` Daniel Baluta
2014-12-23 13:22 ` [PATCH 04/10] iio: imu: kmx61: Fixup parameters alignment Daniel Baluta
2015-01-01 13:47   ` Hartmut Knaack
2015-01-04 10:47     ` Jonathan Cameron
2014-12-23 13:22 ` [PATCH 05/10] iio: imu: kmx61: Drop unused device parameter Daniel Baluta
2015-01-01 13:49   ` Hartmut Knaack
2014-12-23 13:22 ` [PATCH 06/10] iio: imu: kmx61: Use false instead of 0 for ev_enable_state Daniel Baluta
2015-01-01 13:50   ` Hartmut Knaack
2015-01-04 10:49     ` Jonathan Cameron
2014-12-23 13:22 ` [PATCH 07/10] iio: imu: kmx61: Fix device initialization when setting trigger state Daniel Baluta
2015-01-01 13:51   ` Hartmut Knaack
2015-01-04 10:51     ` Jonathan Cameron
2014-12-23 13:22 ` [PATCH 08/10] iio: imu: kmx61: Remove unnecessary REG_INS1 read Daniel Baluta
2015-01-01 13:51   ` Hartmut Knaack
2015-01-04 10:54     ` Jonathan Cameron
2014-12-23 13:22 ` [PATCH 09/10] iio: imu: kmx61: Drop odr_bits from kmx61_samp_freq_table Daniel Baluta
2015-01-01 13:53   ` Hartmut Knaack
2015-01-04 10:55     ` Jonathan Cameron
2015-01-04 11:19       ` Hartmut Knaack
2014-12-23 13:22 ` [PATCH 10/10] iio: imu: kmx61: Use correct base when reading data Daniel Baluta
2015-01-01 13:54   ` Hartmut Knaack
2014-12-26  9:57 ` [PATCH 00/10] iio: KMX61 fixes 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=54A91903.3020800@kernel.org \
    --to=jic23@kernel.org \
    --cc=daniel.baluta@intel.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=srinivas.pandruvada@linux.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).