Skip to contentSkip to conversation

irqchip: st: Convert to DEFINE_SIMPLE_DEV_PM_OPS()

PATCH Applied Triet Hoang 3 participants 3 messages Sep 17 – Oct 15 irqchip drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 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 allows dropping the __maybe_unused annotations from the PM callbacks, also reduces kernel size in case CONFIG_PM or CONFIG_PM_SLEEP is disabled.

---
v2:
- Address the commit message following reviewer's feedback

v1: https://lore.kernel.org/all/[email protected]/

---
 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 Reviewed-by on v2 1/1
#1 lore raw
Quoted 41 lines · Triet Hoang

Convert the deprecated SIMPLE_DEV_PM_OPS to DEFINE_SIMPLE_DEV_PM_OPS and pm_sleep_ptr().

This allows dropping the __maybe_unused annotations from the PM callbacks, also reduces kernel size in case CONFIG_PM or CONFIG_PM_SLEEP is disabled.

---
v2:
- Address the commit message following reviewer's feedback

v1: https://lore.kernel.org/all/[email protected]/
---
 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",

drivers/irqchip/irq-st.c +1 -1
-		.pm = &st_irq_syscfg_pm_ops,
+		.pm = pm_sleep_ptr(&st_irq_syscfg_pm_ops),
Quoted 5 lines

  .of_match_table = st_irq_syscfg_match, },
  .probe = st_irq_syscfg_probe,
--
2.53.0

merge bot Applied
#2 lore raw
In reply to Triet Hoang
The following commit has been merged into the irq/drivers branch of tip:

The following commit has been merged into the irq/drivers branch of tip:

Commit-ID:     e571b39dedb10e64ee97f43e2f51ec918089a0dc
Gitweb:        https://git.kernel.org/tip/e571b39dedb10e64ee97f43e2f51ec918089a0dc
Author:        Triet Hoang <[email protected]>
AuthorDate:    Thu, 17 Sep 2026 08:38:35 +07:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Thu, 15 Oct 2026 11:50:47 +02:00

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 allows dropping the __maybe_unused annotations from the PM 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 de71bb3..fef0521 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,