diff options
| author | Rafael J. Wysocki <rjw@sisk.pl> | 2011-09-26 14:22:02 -0400 |
|---|---|---|
| committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-09-26 14:22:02 -0400 |
| commit | cd0ea672f58d5cfdea271c45cec0c897f2b792aa (patch) | |
| tree | 96596cf00fd4fd84b1eb76626f7cc2e1e05e6a18 /include/linux | |
| parent | 0d41da2e31e81f5c8aaabe17f769de4304b2d4c8 (diff) | |
PM / Domains: Split device PM domain data into base and need_restore
The struct pm_domain_data data type is defined in such a way that
adding new fields specific to the generic PM domains code will
require include/linux/pm.h to be modified. As a result, data types
used only by the generic PM domains code will be defined in two
headers, although they all should be defined in pm_domain.h and
pm.h will need to include more headers, which won't be very nice.
For this reason change the definition of struct pm_subsys_data
so that its domain_data member is a pointer, which will allow
struct pm_domain_data to be subclassed by various PM domains
implementations. Remove the need_restore member from
struct pm_domain_data and make the generic PM domains code
subclass it by adding the need_restore member to the new data type.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/pm.h | 3 | ||||
| -rw-r--r-- | include/linux/pm_domain.h | 10 |
2 files changed, 11 insertions, 2 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h index ed10f24d5259..f25682477f08 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
| @@ -424,7 +424,6 @@ struct wakeup_source; | |||
| 424 | struct pm_domain_data { | 424 | struct pm_domain_data { |
| 425 | struct list_head list_node; | 425 | struct list_head list_node; |
| 426 | struct device *dev; | 426 | struct device *dev; |
| 427 | bool need_restore; | ||
| 428 | }; | 427 | }; |
| 429 | 428 | ||
| 430 | struct pm_subsys_data { | 429 | struct pm_subsys_data { |
| @@ -434,7 +433,7 @@ struct pm_subsys_data { | |||
| 434 | struct list_head clock_list; | 433 | struct list_head clock_list; |
| 435 | #endif | 434 | #endif |
| 436 | #ifdef CONFIG_PM_GENERIC_DOMAINS | 435 | #ifdef CONFIG_PM_GENERIC_DOMAINS |
| 437 | struct pm_domain_data domain_data; | 436 | struct pm_domain_data *domain_data; |
| 438 | #endif | 437 | #endif |
| 439 | }; | 438 | }; |
| 440 | 439 | ||
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 2538d906bcd1..65633e5a2bc0 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h | |||
| @@ -62,6 +62,16 @@ struct gpd_link { | |||
| 62 | struct list_head slave_node; | 62 | struct list_head slave_node; |
| 63 | }; | 63 | }; |
| 64 | 64 | ||
| 65 | struct generic_pm_domain_data { | ||
| 66 | struct pm_domain_data base; | ||
| 67 | bool need_restore; | ||
| 68 | }; | ||
| 69 | |||
| 70 | static inline struct generic_pm_domain_data *to_gpd_data(struct pm_domain_data *pdd) | ||
| 71 | { | ||
| 72 | return container_of(pdd, struct generic_pm_domain_data, base); | ||
| 73 | } | ||
| 74 | |||
| 65 | #ifdef CONFIG_PM_GENERIC_DOMAINS | 75 | #ifdef CONFIG_PM_GENERIC_DOMAINS |
| 66 | extern int pm_genpd_add_device(struct generic_pm_domain *genpd, | 76 | extern int pm_genpd_add_device(struct generic_pm_domain *genpd, |
| 67 | struct device *dev); | 77 | struct device *dev); |
