diff options
Diffstat (limited to 'kernel/power/main.c')
-rw-r--r-- | kernel/power/main.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c index 2a46b6d62f76..854bf0811d40 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c | |||
@@ -32,28 +32,28 @@ DEFINE_MUTEX(pm_mutex); | |||
32 | /* This is just an arbitrary number */ | 32 | /* This is just an arbitrary number */ |
33 | #define FREE_PAGE_NUMBER (100) | 33 | #define FREE_PAGE_NUMBER (100) |
34 | 34 | ||
35 | struct pm_ops *pm_ops; | 35 | struct platform_suspend_ops *suspend_ops; |
36 | 36 | ||
37 | /** | 37 | /** |
38 | * pm_set_ops - Set the global power method table. | 38 | * suspend_set_ops - Set the global suspend method table. |
39 | * @ops: Pointer to ops structure. | 39 | * @ops: Pointer to ops structure. |
40 | */ | 40 | */ |
41 | 41 | ||
42 | void pm_set_ops(struct pm_ops * ops) | 42 | void suspend_set_ops(struct platform_suspend_ops *ops) |
43 | { | 43 | { |
44 | mutex_lock(&pm_mutex); | 44 | mutex_lock(&pm_mutex); |
45 | pm_ops = ops; | 45 | suspend_ops = ops; |
46 | mutex_unlock(&pm_mutex); | 46 | mutex_unlock(&pm_mutex); |
47 | } | 47 | } |
48 | 48 | ||
49 | /** | 49 | /** |
50 | * pm_valid_only_mem - generic memory-only valid callback | 50 | * suspend_valid_only_mem - generic memory-only valid callback |
51 | * | 51 | * |
52 | * pm_ops drivers that implement mem suspend only and only need | 52 | * Platform drivers that implement mem suspend only and only need |
53 | * to check for that in their .valid callback can use this instead | 53 | * to check for that in their .valid callback can use this instead |
54 | * of rolling their own .valid callback. | 54 | * of rolling their own .valid callback. |
55 | */ | 55 | */ |
56 | int pm_valid_only_mem(suspend_state_t state) | 56 | int suspend_valid_only_mem(suspend_state_t state) |
57 | { | 57 | { |
58 | return state == PM_SUSPEND_MEM; | 58 | return state == PM_SUSPEND_MEM; |
59 | } | 59 | } |
@@ -61,8 +61,8 @@ int pm_valid_only_mem(suspend_state_t state) | |||
61 | 61 | ||
62 | static inline void pm_finish(suspend_state_t state) | 62 | static inline void pm_finish(suspend_state_t state) |
63 | { | 63 | { |
64 | if (pm_ops->finish) | 64 | if (suspend_ops->finish) |
65 | pm_ops->finish(state); | 65 | suspend_ops->finish(state); |
66 | } | 66 | } |
67 | 67 | ||
68 | /** | 68 | /** |
@@ -76,7 +76,7 @@ static int suspend_prepare(void) | |||
76 | int error; | 76 | int error; |
77 | unsigned int free_pages; | 77 | unsigned int free_pages; |
78 | 78 | ||
79 | if (!pm_ops || !pm_ops->enter) | 79 | if (!suspend_ops || !suspend_ops->enter) |
80 | return -EPERM; | 80 | return -EPERM; |
81 | 81 | ||
82 | error = pm_notifier_call_chain(PM_SUSPEND_PREPARE); | 82 | error = pm_notifier_call_chain(PM_SUSPEND_PREPARE); |
@@ -139,7 +139,7 @@ static int suspend_enter(suspend_state_t state) | |||
139 | printk(KERN_ERR "Some devices failed to power down\n"); | 139 | printk(KERN_ERR "Some devices failed to power down\n"); |
140 | goto Done; | 140 | goto Done; |
141 | } | 141 | } |
142 | error = pm_ops->enter(state); | 142 | error = suspend_ops->enter(state); |
143 | device_power_up(); | 143 | device_power_up(); |
144 | Done: | 144 | Done: |
145 | arch_suspend_enable_irqs(); | 145 | arch_suspend_enable_irqs(); |
@@ -156,11 +156,11 @@ int suspend_devices_and_enter(suspend_state_t state) | |||
156 | { | 156 | { |
157 | int error; | 157 | int error; |
158 | 158 | ||
159 | if (!pm_ops) | 159 | if (!suspend_ops) |
160 | return -ENOSYS; | 160 | return -ENOSYS; |
161 | 161 | ||
162 | if (pm_ops->set_target) { | 162 | if (suspend_ops->set_target) { |
163 | error = pm_ops->set_target(state); | 163 | error = suspend_ops->set_target(state); |
164 | if (error) | 164 | if (error) |
165 | return error; | 165 | return error; |
166 | } | 166 | } |
@@ -170,8 +170,8 @@ int suspend_devices_and_enter(suspend_state_t state) | |||
170 | printk(KERN_ERR "Some devices failed to suspend\n"); | 170 | printk(KERN_ERR "Some devices failed to suspend\n"); |
171 | goto Resume_console; | 171 | goto Resume_console; |
172 | } | 172 | } |
173 | if (pm_ops->prepare) { | 173 | if (suspend_ops->prepare) { |
174 | error = pm_ops->prepare(state); | 174 | error = suspend_ops->prepare(state); |
175 | if (error) | 175 | if (error) |
176 | goto Resume_devices; | 176 | goto Resume_devices; |
177 | } | 177 | } |
@@ -214,7 +214,7 @@ static inline int valid_state(suspend_state_t state) | |||
214 | /* All states need lowlevel support and need to be valid | 214 | /* All states need lowlevel support and need to be valid |
215 | * to the lowlevel implementation, no valid callback | 215 | * to the lowlevel implementation, no valid callback |
216 | * implies that none are valid. */ | 216 | * implies that none are valid. */ |
217 | if (!pm_ops || !pm_ops->valid || !pm_ops->valid(state)) | 217 | if (!suspend_ops || !suspend_ops->valid || !suspend_ops->valid(state)) |
218 | return 0; | 218 | return 0; |
219 | return 1; | 219 | return 1; |
220 | } | 220 | } |