summaryrefslogtreecommitdiff
path: root/drivers/base/power/wakeup_stats.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/power/wakeup_stats.c')
-rw-r--r--drivers/base/power/wakeup_stats.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/base/power/wakeup_stats.c b/drivers/base/power/wakeup_stats.c
index 220a20ff8918..bc5e3945f7a8 100644
--- a/drivers/base/power/wakeup_stats.c
+++ b/drivers/base/power/wakeup_stats.c
@@ -185,6 +185,19 @@ int wakeup_source_sysfs_add(struct device *parent, struct wakeup_source *ws)
EXPORT_SYMBOL_GPL(wakeup_source_sysfs_add);
/**
+ * pm_wakeup_source_sysfs_add - Add wakeup_source attributes to sysfs
+ * for a device if they're missing.
+ * @parent: Device given wakeup source is associated with
+ */
+int pm_wakeup_source_sysfs_add(struct device *parent)
+{
+ if (!parent->power.wakeup || parent->power.wakeup->dev)
+ return 0;
+
+ return wakeup_source_sysfs_add(parent, parent->power.wakeup);
+}
+
+/**
* wakeup_source_sysfs_remove - Remove wakeup_source attributes from sysfs.
* @ws: Wakeup source to be removed from sysfs.
*/