public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Maxim Kochetkov <fido_max@inbox.ru>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-iio@vger.kernel.org, bigunclemax@gmail.com
Subject: Re: [PATCH v4] iio: adc: ti-ads1015: fix conversion when CONFIG_PM is not set
Date: Sun, 9 Aug 2020 12:50:35 +0100	[thread overview]
Message-ID: <20200809125035.5c24a5b5@archlinux> (raw)
In-Reply-To: <20200803050405.6008-1-fido_max@inbox.ru>

On Mon,  3 Aug 2020 08:04:05 +0300
Maxim Kochetkov <fido_max@inbox.ru> wrote:

> To stop conversion ads1015_set_power_state() function call unimplemented
> function __pm_runtime_suspend() from pm_runtime_put_autosuspend()
> if CONFIG_PM is not set.
> In case of CONFIG_PM is not set: __pm_runtime_suspend() returns -ENOSYS,
> so ads1015_read_raw() failed because ads1015_set_power_state() returns an
> error.
> 
> If CONFIG_PM is disabled, there is no need to start/stop conversion.
> Fix it by adding return 0 function variant if CONFIG_PM is not set.
> 
> Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
> Fixes: ecc24e72f437 ("iio: adc: Add TI ADS1015 ADC driver support")
> Tested-by: Maxim Kiselev <bigunclemax@gmail.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Reviewed-by: Jonathan Cameron <jic23@kernel.org>
Note that I didn't actually give this tag.  It must be formally
given by someone rather than saying a patch looks fine.

Personally I don't give reviewed-by tags for IIO patches as they will
have my sign off anyway and that also reflects having reviewed them.

Applied to the fixes-togreg branch of iio.git (which will be rebased shortly
after rc1 is out) and marked for stable.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/ti-ads1015.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/iio/adc/ti-ads1015.c b/drivers/iio/adc/ti-ads1015.c
> index 5ea4f45d6bad..64fe3b2a6ec6 100644
> --- a/drivers/iio/adc/ti-ads1015.c
> +++ b/drivers/iio/adc/ti-ads1015.c
> @@ -316,6 +316,7 @@ static const struct iio_chan_spec ads1115_channels[] = {
>  	IIO_CHAN_SOFT_TIMESTAMP(ADS1015_TIMESTAMP),
>  };
>  
> +#ifdef CONFIG_PM
>  static int ads1015_set_power_state(struct ads1015_data *data, bool on)
>  {
>  	int ret;
> @@ -333,6 +334,15 @@ static int ads1015_set_power_state(struct ads1015_data *data, bool on)
>  	return ret < 0 ? ret : 0;
>  }
>  
> +#else /* !CONFIG_PM */
> +
> +static int ads1015_set_power_state(struct ads1015_data *data, bool on)
> +{
> +	return 0;
> +}
> +
> +#endif /* !CONFIG_PM */
> +
>  static
>  int ads1015_get_adc_result(struct ads1015_data *data, int chan, int *val)
>  {


      reply	other threads:[~2020-08-09 11:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-03  5:04 [PATCH v4] iio: adc: ti-ads1015: fix conversion when CONFIG_PM is not set Maxim Kochetkov
2020-08-09 11:50 ` Jonathan Cameron [this message]

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=20200809125035.5c24a5b5@archlinux \
    --to=jic23@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bigunclemax@gmail.com \
    --cc=fido_max@inbox.ru \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /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