All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Thierry Reding <thierry.reding@gmail.com>,
	<linux-pwm@vger.kernel.org>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Claudiu Beznea <claudiu.beznea@tuxon.dev>,
	<kernel@pengutronix.de>, <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 02/11] pwm: atmel-tcb: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions
Date: Wed, 11 Oct 2023 12:20:45 +0100	[thread overview]
Message-ID: <20231011122045.00000500@Huawei.com> (raw)
In-Reply-To: <20231010075112.755178-3-u.kleine-koenig@pengutronix.de>

On Tue, 10 Oct 2023 09:51:03 +0200
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:

> This macro has the advantage over SIMPLE_DEV_PM_OPS that we don't have to
> care about when the functions are actually used, so the corresponding
> #ifdef can be dropped.
> 
> Also make use of pm_ptr() to discard all PM related stuff if CONFIG_PM
> isn't enabled.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

I did a lot of these so I still have how it works fresh in my mind
making review hopefully easy :)

> ---
>  drivers/pwm/pwm-atmel-tcb.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/pwm/pwm-atmel-tcb.c b/drivers/pwm/pwm-atmel-tcb.c
> index c00dd37c5fbd..a2be4cb4c073 100644
> --- a/drivers/pwm/pwm-atmel-tcb.c
> +++ b/drivers/pwm/pwm-atmel-tcb.c
> @@ -490,7 +490,6 @@ static const struct of_device_id atmel_tcb_pwm_dt_ids[] = {
>  };
>  MODULE_DEVICE_TABLE(of, atmel_tcb_pwm_dt_ids);
>  
> -#ifdef CONFIG_PM_SLEEP
>  static int atmel_tcb_pwm_suspend(struct device *dev)
>  {
>  	struct atmel_tcb_pwm_chip *tcbpwm = dev_get_drvdata(dev);
> @@ -523,16 +522,15 @@ static int atmel_tcb_pwm_resume(struct device *dev)
>  
>  	return 0;
>  }
> -#endif
>  
> -static SIMPLE_DEV_PM_OPS(atmel_tcb_pwm_pm_ops, atmel_tcb_pwm_suspend,
> -			 atmel_tcb_pwm_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(atmel_tcb_pwm_pm_ops, atmel_tcb_pwm_suspend,
> +				atmel_tcb_pwm_resume);
>  
>  static struct platform_driver atmel_tcb_pwm_driver = {
>  	.driver = {
>  		.name = "atmel-tcb-pwm",
>  		.of_match_table = atmel_tcb_pwm_dt_ids,
> -		.pm = &atmel_tcb_pwm_pm_ops,
> +		.pm = pm_ptr(&atmel_tcb_pwm_pm_ops),
>  	},
>  	.probe = atmel_tcb_pwm_probe,
>  	.remove_new = atmel_tcb_pwm_remove,


WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Thierry Reding <thierry.reding@gmail.com>,
	<linux-pwm@vger.kernel.org>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Claudiu Beznea <claudiu.beznea@tuxon.dev>,
	<kernel@pengutronix.de>, <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 02/11] pwm: atmel-tcb: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions
Date: Wed, 11 Oct 2023 12:20:45 +0100	[thread overview]
Message-ID: <20231011122045.00000500@Huawei.com> (raw)
In-Reply-To: <20231010075112.755178-3-u.kleine-koenig@pengutronix.de>

On Tue, 10 Oct 2023 09:51:03 +0200
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:

> This macro has the advantage over SIMPLE_DEV_PM_OPS that we don't have to
> care about when the functions are actually used, so the corresponding
> #ifdef can be dropped.
> 
> Also make use of pm_ptr() to discard all PM related stuff if CONFIG_PM
> isn't enabled.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

I did a lot of these so I still have how it works fresh in my mind
making review hopefully easy :)

> ---
>  drivers/pwm/pwm-atmel-tcb.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/pwm/pwm-atmel-tcb.c b/drivers/pwm/pwm-atmel-tcb.c
> index c00dd37c5fbd..a2be4cb4c073 100644
> --- a/drivers/pwm/pwm-atmel-tcb.c
> +++ b/drivers/pwm/pwm-atmel-tcb.c
> @@ -490,7 +490,6 @@ static const struct of_device_id atmel_tcb_pwm_dt_ids[] = {
>  };
>  MODULE_DEVICE_TABLE(of, atmel_tcb_pwm_dt_ids);
>  
> -#ifdef CONFIG_PM_SLEEP
>  static int atmel_tcb_pwm_suspend(struct device *dev)
>  {
>  	struct atmel_tcb_pwm_chip *tcbpwm = dev_get_drvdata(dev);
> @@ -523,16 +522,15 @@ static int atmel_tcb_pwm_resume(struct device *dev)
>  
>  	return 0;
>  }
> -#endif
>  
> -static SIMPLE_DEV_PM_OPS(atmel_tcb_pwm_pm_ops, atmel_tcb_pwm_suspend,
> -			 atmel_tcb_pwm_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(atmel_tcb_pwm_pm_ops, atmel_tcb_pwm_suspend,
> +				atmel_tcb_pwm_resume);
>  
>  static struct platform_driver atmel_tcb_pwm_driver = {
>  	.driver = {
>  		.name = "atmel-tcb-pwm",
>  		.of_match_table = atmel_tcb_pwm_dt_ids,
> -		.pm = &atmel_tcb_pwm_pm_ops,
> +		.pm = pm_ptr(&atmel_tcb_pwm_pm_ops),
>  	},
>  	.probe = atmel_tcb_pwm_probe,
>  	.remove_new = atmel_tcb_pwm_remove,


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

  reply	other threads:[~2023-10-11 11:22 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-10  7:51 [PATCH 00/11] pwm: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions Uwe Kleine-König
2023-10-10  7:51 ` Uwe Kleine-König
2023-10-10  7:51 ` [PATCH 01/11] pwm: atmel-hlcdc: " Uwe Kleine-König
2023-10-10  7:51   ` Uwe Kleine-König
2023-10-11 11:19   ` Jonathan Cameron
2023-10-11 11:19     ` Jonathan Cameron
2023-10-10  7:51 ` [PATCH 02/11] pwm: atmel-tcb: " Uwe Kleine-König
2023-10-10  7:51   ` Uwe Kleine-König
2023-10-11 11:20   ` Jonathan Cameron [this message]
2023-10-11 11:20     ` Jonathan Cameron
2023-10-10  7:51 ` [PATCH 03/11] pwm: berlin: " Uwe Kleine-König
2023-10-10  7:51 ` [PATCH 04/11] pwm: brcmstb: " Uwe Kleine-König
2023-10-10  7:51   ` Uwe Kleine-König
2023-10-11 11:21   ` Jonathan Cameron
2023-10-11 11:21     ` Jonathan Cameron
2023-10-11 15:31     ` Uwe Kleine-König
2023-10-11 15:31       ` Uwe Kleine-König
2023-10-11 15:42       ` Florian Fainelli
2023-10-11 15:42         ` Florian Fainelli
2023-10-11 16:48         ` Uwe Kleine-König
2023-10-11 16:48           ` Uwe Kleine-König
2023-10-13 13:35           ` Thierry Reding
2023-10-13 13:35             ` Thierry Reding
2023-10-11 16:48   ` Florian Fainelli
2023-10-11 16:48     ` Florian Fainelli
2023-10-10  7:51 ` [PATCH 05/11] pwm: dwc: " Uwe Kleine-König
2023-10-10  7:51 ` [PATCH 06/11] pwm: imx-tpm: " Uwe Kleine-König
2023-10-10  7:51   ` Uwe Kleine-König
2023-10-11 11:22   ` Jonathan Cameron
2023-10-11 11:22     ` Jonathan Cameron
2023-10-10  7:51 ` [PATCH 07/11] pwm: samsung: " Uwe Kleine-König
2023-10-10  7:51   ` Uwe Kleine-König
2023-10-11 11:22   ` Jonathan Cameron
2023-10-11 11:22     ` Jonathan Cameron
2023-10-10  7:51 ` [PATCH 08/11] pwm: stm32-lp: " Uwe Kleine-König
2023-10-10  7:51   ` Uwe Kleine-König
2023-10-11 11:23   ` Jonathan Cameron
2023-10-11 11:23     ` Jonathan Cameron
2023-10-10  7:51 ` [PATCH 09/11] pwm: stm32: " Uwe Kleine-König
2023-10-10  7:51   ` Uwe Kleine-König
2023-10-11 11:23   ` Jonathan Cameron
2023-10-11 11:23     ` Jonathan Cameron
2023-10-10  7:51 ` [PATCH 10/11] pwm: tiecap: " Uwe Kleine-König
2023-10-10  7:51 ` [PATCH 11/11] pwm: tiehrpwm: " Uwe Kleine-König

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=20231011122045.00000500@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=florian.fainelli@broadcom.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.