* [PATCH] irqchip: st: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
@ 2026-08-21 4:39 Triet Hoang
2026-08-29 19:40 ` Radu Rendec
0 siblings, 1 reply; 3+ messages in thread
From: Triet Hoang @ 2026-08-21 4:39 UTC (permalink / raw)
To: tglx; +Cc: radu, linux-kernel, Triet Hoang
Convert the deprecated SIMPLE_DEV_PM_OPS
to DEFINE_SIMPLE_DEV_PM_OPS
and pm_sleep_ptr().
This lets us drop the __maybe_unused annotations
from its suspend and resume callbacks,
also reduces kernel size in case CONFIG_PM or
CONFIG_PM_SLEEP is disabled.
Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com>
---
drivers/irqchip/irq-st.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/irqchip/irq-st.c b/drivers/irqchip/irq-st.c
index de71bb350d57..fef0521831aa 100644
--- a/drivers/irqchip/irq-st.c
+++ b/drivers/irqchip/irq-st.c
@@ -157,7 +157,7 @@ static int st_irq_syscfg_probe(struct platform_device *pdev)
return st_irq_syscfg_enable(pdev);
}
-static int __maybe_unused st_irq_syscfg_resume(struct device *dev)
+static int st_irq_syscfg_resume(struct device *dev)
{
struct st_irq_syscfg *ddata = dev_get_drvdata(dev);
@@ -165,12 +165,12 @@ static int __maybe_unused st_irq_syscfg_resume(struct device *dev)
ST_A9_IRQ_MASK, ddata->config);
}
-static SIMPLE_DEV_PM_OPS(st_irq_syscfg_pm_ops, NULL, st_irq_syscfg_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(st_irq_syscfg_pm_ops, NULL, st_irq_syscfg_resume);
static struct platform_driver st_irq_syscfg_driver = {
.driver = {
.name = "st_irq_syscfg",
- .pm = &st_irq_syscfg_pm_ops,
+ .pm = pm_sleep_ptr(&st_irq_syscfg_pm_ops),
.of_match_table = st_irq_syscfg_match,
},
.probe = st_irq_syscfg_probe,
--
2.53.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] irqchip: st: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
2026-08-21 4:39 [PATCH] irqchip: st: Convert to DEFINE_SIMPLE_DEV_PM_OPS() Triet Hoang
@ 2026-08-29 19:40 ` Radu Rendec
2026-09-14 9:08 ` Triet Hoang
0 siblings, 1 reply; 3+ messages in thread
From: Radu Rendec @ 2026-08-29 19:40 UTC (permalink / raw)
To: Triet Hoang, tglx; +Cc: linux-kernel
On Fri, 2026-08-21 at 11:39 +0700, Triet Hoang wrote:
> Convert the deprecated SIMPLE_DEV_PM_OPS
> to DEFINE_SIMPLE_DEV_PM_OPS
> and pm_sleep_ptr().
>
> This lets us drop the __maybe_unused annotations
> from its suspend and resume callbacks,
> also reduces kernel size in case CONFIG_PM or
> CONFIG_PM_SLEEP is disabled.
Thanks for the patch! The patch itself (the code change part) looks
good to me. You can improve a little bit on the commit message format:
* Please realign the text to a 72 characters line width.
* Please avoid using the first person in the second paragraph. For
example, something like "This allows dropping the..." is better.
> Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com>
> ---
> drivers/irqchip/irq-st.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/irqchip/irq-st.c b/drivers/irqchip/irq-st.c
> index de71bb350d57..fef0521831aa 100644
> --- a/drivers/irqchip/irq-st.c
> +++ b/drivers/irqchip/irq-st.c
> @@ -157,7 +157,7 @@ static int st_irq_syscfg_probe(struct platform_device *pdev)
> return st_irq_syscfg_enable(pdev);
> }
>
> -static int __maybe_unused st_irq_syscfg_resume(struct device *dev)
> +static int st_irq_syscfg_resume(struct device *dev)
> {
> struct st_irq_syscfg *ddata = dev_get_drvdata(dev);
>
> @@ -165,12 +165,12 @@ static int __maybe_unused st_irq_syscfg_resume(struct device *dev)
> ST_A9_IRQ_MASK, ddata->config);
> }
>
> -static SIMPLE_DEV_PM_OPS(st_irq_syscfg_pm_ops, NULL, st_irq_syscfg_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(st_irq_syscfg_pm_ops, NULL, st_irq_syscfg_resume);
>
> static struct platform_driver st_irq_syscfg_driver = {
> .driver = {
> .name = "st_irq_syscfg",
> - .pm = &st_irq_syscfg_pm_ops,
> + .pm = pm_sleep_ptr(&st_irq_syscfg_pm_ops),
> .of_match_table = st_irq_syscfg_match,
> },
> .probe = st_irq_syscfg_probe,
--
Regards,
Radu
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] irqchip: st: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
2026-08-29 19:40 ` Radu Rendec
@ 2026-09-14 9:08 ` Triet Hoang
0 siblings, 0 replies; 3+ messages in thread
From: Triet Hoang @ 2026-09-14 9:08 UTC (permalink / raw)
To: radu; +Cc: linux-kernel, tglx, triet.hoang.dev
On Sat, 29 Aug 2026 15:40:50 -0400 Radu Rendec wrote:
> Thanks for the patch! The patch itself (the code change part) looks
> good to me. You can improve a little bit on the commit message format:
> * Please realign the text to a 72 characters line width.
> * Please avoid using the first person in the second paragraph. For
> example, something like "This allows dropping the..." is better.
Thanks for your review! Should I send the v2 to improve this?
Regards,
Triet
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-09-14 9:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-21 4:39 [PATCH] irqchip: st: Convert to DEFINE_SIMPLE_DEV_PM_OPS() Triet Hoang
2026-08-29 19:40 ` Radu Rendec
2026-09-14 9:08 ` Triet Hoang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®