linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Paul Cercueil <paul@crapouillou.net>
Cc: Wolfram Sang <wsa@kernel.org>, <linux-i2c@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 14/23] i2c: nomadik: Remove #ifdef guards for PM related functions
Date: Thu, 6 Jul 2023 10:41:53 +0800	[thread overview]
Message-ID: <20230706104153.00007c5f@Huawei.com> (raw)
In-Reply-To: <20230705204314.89800-15-paul@crapouillou.net>

On Wed,  5 Jul 2023 22:43:05 +0200
Paul Cercueil <paul@crapouillou.net> wrote:

> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> 
> This has the advantage of always compiling these functions in,
> independently of any Kconfig option. Thanks to that, bugs and other
> regressions are subsequently easier to catch.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> 
Might be worth rewrapping the runtime pm line. Otherwise LGTM

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-arm-kernel@lists.infradead.org
> ---
>  drivers/i2c/busses/i2c-nomadik.c | 14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c
> index 1e5fd23ef45c..4a4b5bc257ae 100644
> --- a/drivers/i2c/busses/i2c-nomadik.c
> +++ b/drivers/i2c/busses/i2c-nomadik.c
> @@ -873,7 +873,6 @@ static irqreturn_t i2c_irq_handler(int irq, void *arg)
>  	return IRQ_HANDLED;
>  }
>  
> -#ifdef CONFIG_PM_SLEEP
>  static int nmk_i2c_suspend_late(struct device *dev)
>  {
>  	int ret;
> @@ -890,9 +889,7 @@ static int nmk_i2c_resume_early(struct device *dev)
>  {
>  	return pm_runtime_force_resume(dev);
>  }
> -#endif
>  
> -#ifdef CONFIG_PM
>  static int nmk_i2c_runtime_suspend(struct device *dev)
>  {
>  	struct amba_device *adev = to_amba_device(dev);
> @@ -925,13 +922,12 @@ static int nmk_i2c_runtime_resume(struct device *dev)
>  
>  	return ret;
>  }
> -#endif
>  
>  static const struct dev_pm_ops nmk_i2c_pm = {
> -	SET_LATE_SYSTEM_SLEEP_PM_OPS(nmk_i2c_suspend_late, nmk_i2c_resume_early)
> -	SET_RUNTIME_PM_OPS(nmk_i2c_runtime_suspend,
> -			nmk_i2c_runtime_resume,
> -			NULL)
> +	LATE_SYSTEM_SLEEP_PM_OPS(nmk_i2c_suspend_late, nmk_i2c_resume_early)
> +	RUNTIME_PM_OPS(nmk_i2c_runtime_suspend,
> +		       nmk_i2c_runtime_resume,
> +		       NULL)

rewrap?

>  };
>  
>  static unsigned int nmk_i2c_functionality(struct i2c_adapter *adap)
> @@ -1080,7 +1076,7 @@ static struct amba_driver nmk_i2c_driver = {
>  	.drv = {
>  		.owner = THIS_MODULE,
>  		.name = DRIVER_NAME,
> -		.pm = &nmk_i2c_pm,
> +		.pm = pm_ptr(&nmk_i2c_pm),
>  	},
>  	.id_table = nmk_i2c_ids,
>  	.probe = nmk_i2c_probe,


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-07-06  2:42 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-05 20:42 [PATCH 00/23] i2c: Use new PM macros Paul Cercueil
2023-07-05 20:42 ` [PATCH 03/23] i2c: iproc: Remove #ifdef guards for PM related functions Paul Cercueil
2023-07-06  2:11   ` Jonathan Cameron
2023-07-06 17:01   ` Ray Jui
2023-07-05 20:42 ` [PATCH 04/23] i2c: brcmstb: " Paul Cercueil
2023-07-06  2:12   ` Jonathan Cameron
2023-07-05 20:42 ` [PATCH 05/23] i2c: davinci: " Paul Cercueil
2023-07-06  2:15   ` Jonathan Cameron
2023-07-05 20:42 ` [PATCH 07/23] i2c: exynos5: " Paul Cercueil
2023-07-06  2:25   ` Jonathan Cameron
2023-07-05 20:43 ` [PATCH 12/23] i2c: lpc2k: " Paul Cercueil
2023-07-06  2:39   ` Jonathan Cameron
2023-07-05 20:43 ` [PATCH 13/23] i2c: mt65xx: " Paul Cercueil
2023-07-06  2:40   ` Jonathan Cameron
2023-07-05 20:43 ` [PATCH 14/23] i2c: nomadik: " Paul Cercueil
2023-07-06  2:41   ` Jonathan Cameron [this message]
2023-07-06 17:12   ` Linus Walleij
2023-07-05 20:43 ` [PATCH 16/23] i2c: pnx: " Paul Cercueil
2023-07-06  2:49   ` Jonathan Cameron
     [not found] ` <20230705204521.90050-1-paul@crapouillou.net>
2023-07-05 20:45   ` [PATCH 20/23] i2c: s3c2410: " Paul Cercueil
2023-07-06  3:06     ` 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=20230706104153.00007c5f@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul@crapouillou.net \
    --cc=wsa@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).