linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Akinobu Mita <akinobu.mita@gmail.com>
Cc: linux-iio@vger.kernel.org, Daniel Baluta <daniel.baluta@gmail.com>
Subject: Re: [PATCH v3 05/11] iio: adc: ti-ads1015: don't return invalid value from buffer setup callbacks
Date: Sun, 30 Jul 2017 18:01:23 +0100	[thread overview]
Message-ID: <20170730180123.6984ffd2@kernel.org> (raw)
In-Reply-To: <1501427575-31045-6-git-send-email-akinobu.mita@gmail.com>

On Mon, 31 Jul 2017 00:12:49 +0900
Akinobu Mita <akinobu.mita@gmail.com> wrote:

> pm_runtime_get_sync() and pm_runtime_put_autosuspend() return 0 on
> success, 1 if the device's runtime PM status was already requested status
> or error code on failure.  So a positive return value doesn't indicate an
> error condition.
> 
> However, any non-zero return values from buffer preenable and postdisable
> callbacks are recognized as an error and this driver reuses the return
> value from pm_runtime_get_sync() and pm_runtime_put_autosuspend() in
> these callbacks.  This change fixes the false error detections.
> 
> Cc: Daniel Baluta <daniel.baluta@gmail.com>
> Cc: Jonathan Cameron <jic23@kernel.org>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Applied to the fixes-togreg branch of iio.git marked for
stable.

Thanks,

Jonathan
> ---
>  drivers/iio/adc/ti-ads1015.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/ti-ads1015.c b/drivers/iio/adc/ti-ads1015.c
> index 8905f0d..1c475e2 100644
> --- a/drivers/iio/adc/ti-ads1015.c
> +++ b/drivers/iio/adc/ti-ads1015.c
> @@ -235,7 +235,7 @@ static int ads1015_set_power_state(struct ads1015_data *data, bool on)
>  		ret = pm_runtime_put_autosuspend(dev);
>  	}
>  
> -	return ret;
> +	return ret < 0 ? ret : 0;
>  }
>  
>  static


  reply	other threads:[~2017-07-30 17:01 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-30 15:12 [PATCH v3 00/11] iio: adc: ti-ads1015: fixes, cleanups, and threshold event support Akinobu Mita
2017-07-30 15:12 ` [PATCH v3 01/11] iio: adc: ti-ads1015: fix incorrect data rate setting update Akinobu Mita
2017-07-30 16:57   ` Jonathan Cameron
2017-07-30 15:12 ` [PATCH v3 02/11] iio: adc: ti-ads1015: fix scale information for ADS1115 Akinobu Mita
2017-07-30 16:58   ` Jonathan Cameron
2017-07-30 15:12 ` [PATCH v3 03/11] iio: adc: ti-ads1015: enable conversion when CONFIG_PM is not set Akinobu Mita
2017-07-30 16:59   ` Jonathan Cameron
2017-07-30 15:12 ` [PATCH v3 04/11] iio: adc: ti-ads1015: avoid getting stale result after runtime resume Akinobu Mita
2017-07-30 17:00   ` Jonathan Cameron
2017-07-30 15:12 ` [PATCH v3 05/11] iio: adc: ti-ads1015: don't return invalid value from buffer setup callbacks Akinobu Mita
2017-07-30 17:01   ` Jonathan Cameron [this message]
2017-07-30 15:12 ` [PATCH v3 06/11] iio: adc: ti-ads1015: add adequate wait time to get correct conversion Akinobu Mita
2017-07-30 17:03   ` Jonathan Cameron
2017-07-30 15:12 ` [PATCH v3 07/11] iio: adc: ti-ads1015: remove unnecessary config register update Akinobu Mita
2017-07-30 15:12 ` [PATCH v3 08/11] iio: adc: ti-ads1015: add helper to set conversion mode Akinobu Mita
2017-07-30 15:12 ` [PATCH v3 09/11] iio: adc: ti-ads1015: use devm_iio_triggered_buffer_setup Akinobu Mita
2017-07-30 15:12 ` [PATCH v3 10/11] iio: adc: ti-ads1015: use iio_device_claim_direct_mode() Akinobu Mita
2017-07-30 15:12 ` [PATCH v3 11/11] iio: adc: ti-ads1015: add threshold event support Akinobu Mita
2017-07-30 16:58   ` Jonathan Cameron
2017-09-30 17:32     ` Jonathan Cameron
2017-10-02 13:30       ` Akinobu Mita

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=20170730180123.6984ffd2@kernel.org \
    --to=jic23@kernel.org \
    --cc=akinobu.mita@gmail.com \
    --cc=daniel.baluta@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    /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).