From: Nicolas Ferre <nicolas.ferre@microchip.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Thierry Reding" <thierry.reding@gmail.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>,
Claudiu Beznea <claudiu.beznea@tuxon.dev>,
<linux-pwm@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>, <kernel@pengutronix.de>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH v3 01/11] pwm: atmel-hlcdc: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions
Date: Tue, 24 Oct 2023 09:42:52 +0200 [thread overview]
Message-ID: <a24c273a-487b-4654-906d-0ff516027707@microchip.com> (raw)
In-Reply-To: <20231023174616.2282067-14-u.kleine-koenig@pengutronix.de>
On 23/10/2023 at 19:46, Uwe Kleine-König 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.
>
> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
> ---
> drivers/pwm/pwm-atmel-hlcdc.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/pwm/pwm-atmel-hlcdc.c b/drivers/pwm/pwm-atmel-hlcdc.c
> index 07920e034757..3f2c5031a3ba 100644
> --- a/drivers/pwm/pwm-atmel-hlcdc.c
> +++ b/drivers/pwm/pwm-atmel-hlcdc.c
> @@ -180,7 +180,6 @@ static const struct atmel_hlcdc_pwm_errata atmel_hlcdc_pwm_sama5d3_errata = {
> .div1_clk_erratum = true,
> };
>
> -#ifdef CONFIG_PM_SLEEP
> static int atmel_hlcdc_pwm_suspend(struct device *dev)
> {
> struct atmel_hlcdc_pwm *atmel = dev_get_drvdata(dev);
> @@ -210,10 +209,9 @@ static int atmel_hlcdc_pwm_resume(struct device *dev)
> return atmel_hlcdc_pwm_apply(&atmel->chip, &atmel->chip.pwms[0],
> &state);
> }
> -#endif
>
> -static SIMPLE_DEV_PM_OPS(atmel_hlcdc_pwm_pm_ops,
> - atmel_hlcdc_pwm_suspend, atmel_hlcdc_pwm_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(atmel_hlcdc_pwm_pm_ops,
> + atmel_hlcdc_pwm_suspend, atmel_hlcdc_pwm_resume);
>
> static const struct of_device_id atmel_hlcdc_dt_ids[] = {
> {
> @@ -297,7 +295,7 @@ static struct platform_driver atmel_hlcdc_pwm_driver = {
> .driver = {
> .name = "atmel-hlcdc-pwm",
> .of_match_table = atmel_hlcdc_pwm_dt_ids,
> - .pm = &atmel_hlcdc_pwm_pm_ops,
> + .pm = pm_ptr(&atmel_hlcdc_pwm_pm_ops),
> },
> .probe = atmel_hlcdc_pwm_probe,
> .remove_new = atmel_hlcdc_pwm_remove,
> --
> 2.42.0
>
next prev parent reply other threads:[~2023-10-24 7:44 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-23 17:46 [PATCH v3 00/11] pwm: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions Uwe Kleine-König
2023-10-23 17:46 ` [PATCH v3 01/11] pwm: atmel-hlcdc: " Uwe Kleine-König
2023-10-24 7:42 ` Nicolas Ferre [this message]
2023-10-23 17:46 ` [PATCH v3 02/11] pwm: atmel-tcb: " Uwe Kleine-König
2023-10-24 7:43 ` Nicolas Ferre
2023-10-23 17:46 ` [PATCH v3 03/11] pwm: berlin: " Uwe Kleine-König
2023-10-23 17:46 ` [PATCH v3 04/11] pwm: brcmstb: " Uwe Kleine-König
2023-10-23 17:46 ` [PATCH v3 05/11] pwm: dwc: " Uwe Kleine-König
2023-10-23 17:46 ` [PATCH v3 06/11] pwm: imx-tpm: " Uwe Kleine-König
2023-10-23 17:46 ` [PATCH v3 07/11] pwm: samsung: " Uwe Kleine-König
2023-10-24 21:42 ` Andi Shyti
2023-10-23 17:46 ` [PATCH v3 08/11] pwm: stm32-lp: " Uwe Kleine-König
2023-11-14 13:47 ` Fabrice Gasnier
2023-10-23 17:46 ` [PATCH v3 09/11] pwm: stm32: " Uwe Kleine-König
2023-11-14 13:47 ` Fabrice Gasnier
2023-10-23 17:46 ` [PATCH v3 10/11] pwm: tiecap: " Uwe Kleine-König
2023-10-23 17:46 ` [PATCH v3 11/11] pwm: tiehrpwm: " Uwe Kleine-König
2023-11-28 17:00 ` [PATCH v3 00/11] pwm: " Thierry Reding
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=a24c273a-487b-4654-906d-0ff516027707@microchip.com \
--to=nicolas.ferre@microchip.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=alexandre.belloni@bootlin.com \
--cc=claudiu.beznea@tuxon.dev \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox