From: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Thierry Reding" <thierry.reding@gmail.com>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
<linux-pwm@vger.kernel.org>,
<linux-stm32@st-md-mailman.stormreply.com>,
<linux-arm-kernel@lists.infradead.org>, <kernel@pengutronix.de>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH v3 08/11] pwm: stm32-lp: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions
Date: Tue, 14 Nov 2023 14:47:04 +0100 [thread overview]
Message-ID: <95ec2b8d-8805-4ef9-9573-d796755f24d1@foss.st.com> (raw)
In-Reply-To: <20231023174616.2282067-21-u.kleine-koenig@pengutronix.de>
On 10/23/23 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
> __maybe_unused 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>
> ---
> drivers/pwm/pwm-stm32-lp.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
Hi Uwe,
Reviewed-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Thanks for the cleanups.
Fabrice
>
> diff --git a/drivers/pwm/pwm-stm32-lp.c b/drivers/pwm/pwm-stm32-lp.c
> index b67974cc1872..439068f3eca1 100644
> --- a/drivers/pwm/pwm-stm32-lp.c
> +++ b/drivers/pwm/pwm-stm32-lp.c
> @@ -218,7 +218,7 @@ static int stm32_pwm_lp_probe(struct platform_device *pdev)
> return 0;
> }
>
> -static int __maybe_unused stm32_pwm_lp_suspend(struct device *dev)
> +static int stm32_pwm_lp_suspend(struct device *dev)
> {
> struct stm32_pwm_lp *priv = dev_get_drvdata(dev);
> struct pwm_state state;
> @@ -233,13 +233,13 @@ static int __maybe_unused stm32_pwm_lp_suspend(struct device *dev)
> return pinctrl_pm_select_sleep_state(dev);
> }
>
> -static int __maybe_unused stm32_pwm_lp_resume(struct device *dev)
> +static int stm32_pwm_lp_resume(struct device *dev)
> {
> return pinctrl_pm_select_default_state(dev);
> }
>
> -static SIMPLE_DEV_PM_OPS(stm32_pwm_lp_pm_ops, stm32_pwm_lp_suspend,
> - stm32_pwm_lp_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(stm32_pwm_lp_pm_ops, stm32_pwm_lp_suspend,
> + stm32_pwm_lp_resume);
>
> static const struct of_device_id stm32_pwm_lp_of_match[] = {
> { .compatible = "st,stm32-pwm-lp", },
> @@ -252,7 +252,7 @@ static struct platform_driver stm32_pwm_lp_driver = {
> .driver = {
> .name = "stm32-pwm-lp",
> .of_match_table = stm32_pwm_lp_of_match,
> - .pm = &stm32_pwm_lp_pm_ops,
> + .pm = pm_ptr(&stm32_pwm_lp_pm_ops),
> },
> };
> module_platform_driver(stm32_pwm_lp_driver);
next prev parent reply other threads:[~2023-11-14 13:47 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
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 [this message]
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=95ec2b8d-8805-4ef9-9573-d796755f24d1@foss.st.com \
--to=fabrice.gasnier@foss.st.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=alexandre.torgue@foss.st.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pwm@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--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