aboutsummaryrefslogtreecommitdiff
path: root/include/linux/pm.h
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2011-08-25 15:34:01 +0200
committerRafael J. Wysocki <rjw@sisk.pl>2011-08-25 15:34:01 +0200
commitef27bed1870dbd5fd363ff5ec51eebd5a695e277 (patch)
treeef563bb07f259386fbe2477ec9a01e7ead011bcc /include/linux/pm.h
parent5c095a0e0d600d5a5a4207eaadabd18db46395ce (diff)
PM: Reference counting of power.subsys_data
Since the power.subsys_data device field will be used by multiple filesystems, introduce a reference counting mechanism for it to avoid freeing it prematurely or changing its value at a wrong time. Make the PM clocks management code that currently is the only user of power.subsys_data use the new reference counting. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'include/linux/pm.h')
-rw-r--r--include/linux/pm.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h
index bf5ee37388d..c6b5a0a41ab 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -423,6 +423,7 @@ struct wakeup_source;
struct pm_subsys_data {
spinlock_t lock;
+ unsigned int refcount;
#ifdef CONFIG_PM_CLK
struct list_head clock_list;
#endif
@@ -473,6 +474,8 @@ struct dev_pm_info {
};
extern void update_pm_runtime_accounting(struct device *dev);
+extern int dev_pm_get_subsys_data(struct device *dev);
+extern int dev_pm_put_subsys_data(struct device *dev);
/*
* Power domains provide callbacks that are executed during system suspend,