Skip to contentSkip to conversation

irqchip: st: Convert to DEFINE_SIMPLE_DEV_PM_OPS()

PATCH Superseded Triet Hoang 2 participants 4 messages Aug 21 – Sep 16 irqchip drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 irqchip: st: Convert to DEFINE_SIMPLE_DEV_PM_OPS()

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.

---
 drivers/irqchip/irq-st.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/irqchip/irq-st.c +3 -3
index de71bb350d57..fef0521831aa 100644
@@ -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,
Signature · 1 line
2.53.0
reviewer
#1 lore raw
Quoted 8 lines · 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.

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.

Quoted 33 lines

---
 drivers/irqchip/irq-st.c | 6 +++---

 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/irqchip/irq-st.c +0 -0
index de71bb350d57..fef0521831aa 100644
@@ -157,7 +157,7 @@ static int st_irq_syscfg_probe(struct platform_device *pdev)
   return st_irq_syscfg_enable(pdev);
  }

drivers/irqchip/irq-st.c +1 -1
-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);

drivers/irqchip/irq-st.c +0 -0
@@ -165,12 +165,12 @@ static int __maybe_unused st_irq_syscfg_resume(struct device *dev)
     ST_A9_IRQ_MASK, ddata->config);
  }

drivers/irqchip/irq-st.c +1 -1
-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,

Signature · 2 lines
Regards,
Radu
#2 lore raw
Quoted 5 lines · 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

reviewer
#3 lore raw
Quoted 9 lines · Triet Hoang
Quoted 5 lines · 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?

You're welcome. Yes, please send v2. That will bump the patch to the top of Thomas's inbox and also I'll be able to provide a r-b tag. Thanks.

Signature · 2 lines
Regards,
Radu