diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2011-08-25 09:34:01 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-08-25 09:34:01 -0400 |
commit | ef27bed1870dbd5fd363ff5ec51eebd5a695e277 (patch) | |
tree | ef563bb07f259386fbe2477ec9a01e7ead011bcc /include/linux/pm.h | |
parent | 5c095a0e0d600d5a5a4207eaadabd18db46395ce (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.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h index bf5ee37388d4..c6b5a0a41ab3 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -423,6 +423,7 @@ struct wakeup_source; | |||
423 | 423 | ||
424 | struct pm_subsys_data { | 424 | struct pm_subsys_data { |
425 | spinlock_t lock; | 425 | spinlock_t lock; |
426 | unsigned int refcount; | ||
426 | #ifdef CONFIG_PM_CLK | 427 | #ifdef CONFIG_PM_CLK |
427 | struct list_head clock_list; | 428 | struct list_head clock_list; |
428 | #endif | 429 | #endif |
@@ -473,6 +474,8 @@ struct dev_pm_info { | |||
473 | }; | 474 | }; |
474 | 475 | ||
475 | extern void update_pm_runtime_accounting(struct device *dev); | 476 | extern void update_pm_runtime_accounting(struct device *dev); |
477 | extern int dev_pm_get_subsys_data(struct device *dev); | ||
478 | extern int dev_pm_put_subsys_data(struct device *dev); | ||
476 | 479 | ||
477 | /* | 480 | /* |
478 | * Power domains provide callbacks that are executed during system suspend, | 481 | * Power domains provide callbacks that are executed during system suspend, |