Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: linux-iio@vger.kernel.org
Cc: Paul Cercueil <paul@crapouillou.net>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Biju Das <biju.das.jz@bp.renesas.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Prabhakar <prabhakar.csengg@gmail.com>
Subject: Re: [PATCH] iio: adc: rzg2l: Use RUNTIME_PM_OPS() instead of SET_*
Date: Sat, 28 Jan 2023 18:06:18 +0000	[thread overview]
Message-ID: <20230128180618.727ae295@jic23-huawei> (raw)
In-Reply-To: <20220807190712.1039403-1-jic23@kernel.org>

On Sun,  7 Aug 2022 20:07:12 +0100
Jonathan Cameron <jic23@kernel.org> wrote:

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> Here we could use DEFINE_RUNTIME_DEV_PM_OPS() but that would have the
> side effect of providing suspend and resume support.  That would be
> harmless but also of little purpose as this driver does very simplistic
> power management with synchronous power up and down around individual
> channel reads.
> 
> In general these new PM macros avoid the need to mark functions
> __maybe_unused, whilst still allowing the compiler to remove them
> if they are unused.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Biju Das <biju.das.jz@bp.renesas.com>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>

+CC Prabhakar on basis of recent DT binding patch might have hardware
 to test changing this to DEFINE_RUNTIME_DEV_PM_OPS.

If not I'm tempted to just pick this one up on basis it does
no harm and we can revisit later.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/rzg2l_adc.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/iio/adc/rzg2l_adc.c b/drivers/iio/adc/rzg2l_adc.c
> index 0921ff2d9b3a..b859a2db6b13 100644
> --- a/drivers/iio/adc/rzg2l_adc.c
> +++ b/drivers/iio/adc/rzg2l_adc.c
> @@ -547,7 +547,7 @@ static const struct of_device_id rzg2l_adc_match[] = {
>  };
>  MODULE_DEVICE_TABLE(of, rzg2l_adc_match);
>  
> -static int __maybe_unused rzg2l_adc_pm_runtime_suspend(struct device *dev)
> +static int rzg2l_adc_pm_runtime_suspend(struct device *dev)
>  {
>  	struct iio_dev *indio_dev = dev_get_drvdata(dev);
>  	struct rzg2l_adc *adc = iio_priv(indio_dev);
> @@ -559,7 +559,7 @@ static int __maybe_unused rzg2l_adc_pm_runtime_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int __maybe_unused rzg2l_adc_pm_runtime_resume(struct device *dev)
> +static int rzg2l_adc_pm_runtime_resume(struct device *dev)
>  {
>  	struct iio_dev *indio_dev = dev_get_drvdata(dev);
>  	struct rzg2l_adc *adc = iio_priv(indio_dev);
> @@ -581,9 +581,9 @@ static int __maybe_unused rzg2l_adc_pm_runtime_resume(struct device *dev)
>  }
>  
>  static const struct dev_pm_ops rzg2l_adc_pm_ops = {
> -	SET_RUNTIME_PM_OPS(rzg2l_adc_pm_runtime_suspend,
> -			   rzg2l_adc_pm_runtime_resume,
> -			   NULL)
> +	RUNTIME_PM_OPS(rzg2l_adc_pm_runtime_suspend,
> +		       rzg2l_adc_pm_runtime_resume,
> +		       NULL)
>  };
>  
>  static struct platform_driver rzg2l_adc_driver = {
> @@ -591,7 +591,7 @@ static struct platform_driver rzg2l_adc_driver = {
>  	.driver		= {
>  		.name		= DRIVER_NAME,
>  		.of_match_table = rzg2l_adc_match,
> -		.pm		= &rzg2l_adc_pm_ops,
> +		.pm		= pm_ptr(&rzg2l_adc_pm_ops),
>  	},
>  };
>  


      parent reply	other threads:[~2023-01-28 17:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-07 19:07 [PATCH] iio: adc: rzg2l: Use RUNTIME_PM_OPS() instead of SET_* Jonathan Cameron
2022-08-08  9:34 ` Andy Shevchenko
2022-08-13 16:13   ` Jonathan Cameron
2022-08-14 19:12     ` Andy Shevchenko
2022-08-20 11:40       ` Jonathan Cameron
2023-01-28 18:06 ` 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=20230128180618.727ae295@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=linux-iio@vger.kernel.org \
    --cc=paul@crapouillou.net \
    --cc=prabhakar.csengg@gmail.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