summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2025-01-03 11:41:13 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2025-01-17 22:27:46 +0300
commitfd8318a32573d73eb20637a0c80689de0dc98169 (patch)
treedc4b82be08d4ac106638ede6eca082ddf0656a04 /include/linux
parent56cabb937f8f6091c231bdbc17c0d0a10130fb5d (diff)
downloadlinux-fd8318a32573d73eb20637a0c80689de0dc98169.tar.xz
PM: sleep: wakeirq: Introduce device-managed variant of dev_pm_set_wake_irq()
Add device-managed variant of dev_pm_set_wake_irq which automatically clear the wake irq on device destruction to simplify error handling and resource management in drivers. Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://patch.msgid.link/20250103-wake_irq-v2-1-e3aeff5e9966@nxp.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/pm_wakeirq.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/pm_wakeirq.h b/include/linux/pm_wakeirq.h
index d9642c6cf852..25b63ed51b76 100644
--- a/include/linux/pm_wakeirq.h
+++ b/include/linux/pm_wakeirq.h
@@ -10,6 +10,7 @@ extern int dev_pm_set_wake_irq(struct device *dev, int irq);
extern int dev_pm_set_dedicated_wake_irq(struct device *dev, int irq);
extern int dev_pm_set_dedicated_wake_irq_reverse(struct device *dev, int irq);
extern void dev_pm_clear_wake_irq(struct device *dev);
+extern int devm_pm_set_wake_irq(struct device *dev, int irq);
#else /* !CONFIG_PM */
@@ -32,5 +33,10 @@ static inline void dev_pm_clear_wake_irq(struct device *dev)
{
}
+static inline int devm_pm_set_wake_irq(struct device *dev, int irq)
+{
+ return 0;
+}
+
#endif /* CONFIG_PM */
#endif /* _LINUX_PM_WAKEIRQ_H */