diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/frv/kernel/pm.c | 8 | ||||
-rw-r--r-- | arch/mips/au1000/common/power.c | 17 | ||||
-rw-r--r-- | arch/x86/kernel/apm_32.c | 15 |
3 files changed, 2 insertions, 38 deletions
diff --git a/arch/frv/kernel/pm.c b/arch/frv/kernel/pm.c index c57ce3f1f2e2..73f3aeefd203 100644 --- a/arch/frv/kernel/pm.c +++ b/arch/frv/kernel/pm.c | |||
@@ -163,14 +163,11 @@ static int sysctl_pm_do_suspend(ctl_table *ctl, int write, struct file *filp, | |||
163 | if ((mode != 1) && (mode != 5)) | 163 | if ((mode != 1) && (mode != 5)) |
164 | return -EINVAL; | 164 | return -EINVAL; |
165 | 165 | ||
166 | retval = pm_send_all(PM_SUSPEND, (void *)3); | ||
167 | |||
168 | if (retval == 0) { | 166 | if (retval == 0) { |
169 | if (mode == 5) | 167 | if (mode == 5) |
170 | retval = pm_do_bus_sleep(); | 168 | retval = pm_do_bus_sleep(); |
171 | else | 169 | else |
172 | retval = pm_do_suspend(); | 170 | retval = pm_do_suspend(); |
173 | pm_send_all(PM_RESUME, (void *)0); | ||
174 | } | 171 | } |
175 | 172 | ||
176 | return retval; | 173 | return retval; |
@@ -183,9 +180,6 @@ static int try_set_cmode(int new_cmode) | |||
183 | if (!(clock_cmodes_permitted & (1<<new_cmode))) | 180 | if (!(clock_cmodes_permitted & (1<<new_cmode))) |
184 | return -EINVAL; | 181 | return -EINVAL; |
185 | 182 | ||
186 | /* tell all the drivers we're suspending */ | ||
187 | pm_send_all(PM_SUSPEND, (void *)3); | ||
188 | |||
189 | /* now change cmode */ | 183 | /* now change cmode */ |
190 | local_irq_disable(); | 184 | local_irq_disable(); |
191 | frv_dma_pause_all(); | 185 | frv_dma_pause_all(); |
@@ -201,8 +195,6 @@ static int try_set_cmode(int new_cmode) | |||
201 | frv_dma_resume_all(); | 195 | frv_dma_resume_all(); |
202 | local_irq_enable(); | 196 | local_irq_enable(); |
203 | 197 | ||
204 | /* tell all the drivers we're resuming */ | ||
205 | pm_send_all(PM_RESUME, (void *)0); | ||
206 | return 0; | 198 | return 0; |
207 | } | 199 | } |
208 | 200 | ||
diff --git a/arch/mips/au1000/common/power.c b/arch/mips/au1000/common/power.c index 54047d69b820..a9f7f6371e4b 100644 --- a/arch/mips/au1000/common/power.c +++ b/arch/mips/au1000/common/power.c | |||
@@ -258,7 +258,6 @@ int au_sleep(void) | |||
258 | static int pm_do_sleep(ctl_table * ctl, int write, struct file *file, | 258 | static int pm_do_sleep(ctl_table * ctl, int write, struct file *file, |
259 | void __user *buffer, size_t * len, loff_t *ppos) | 259 | void __user *buffer, size_t * len, loff_t *ppos) |
260 | { | 260 | { |
261 | int retval = 0; | ||
262 | #ifdef SLEEP_TEST_TIMEOUT | 261 | #ifdef SLEEP_TEST_TIMEOUT |
263 | #define TMPBUFLEN2 16 | 262 | #define TMPBUFLEN2 16 |
264 | char buf[TMPBUFLEN2], *p; | 263 | char buf[TMPBUFLEN2], *p; |
@@ -278,33 +277,21 @@ static int pm_do_sleep(ctl_table * ctl, int write, struct file *file, | |||
278 | p = buf; | 277 | p = buf; |
279 | sleep_ticks = simple_strtoul(p, &p, 0); | 278 | sleep_ticks = simple_strtoul(p, &p, 0); |
280 | #endif | 279 | #endif |
281 | retval = pm_send_all(PM_SUSPEND, (void *) 2); | ||
282 | |||
283 | if (retval) | ||
284 | return retval; | ||
285 | 280 | ||
286 | au_sleep(); | 281 | au_sleep(); |
287 | retval = pm_send_all(PM_RESUME, (void *) 0); | ||
288 | } | 282 | } |
289 | return retval; | 283 | return 0; |
290 | } | 284 | } |
291 | 285 | ||
292 | static int pm_do_suspend(ctl_table * ctl, int write, struct file *file, | 286 | static int pm_do_suspend(ctl_table * ctl, int write, struct file *file, |
293 | void __user *buffer, size_t * len, loff_t *ppos) | 287 | void __user *buffer, size_t * len, loff_t *ppos) |
294 | { | 288 | { |
295 | int retval = 0; | ||
296 | |||
297 | if (!write) { | 289 | if (!write) { |
298 | *len = 0; | 290 | *len = 0; |
299 | } else { | 291 | } else { |
300 | retval = pm_send_all(PM_SUSPEND, (void *) 2); | ||
301 | if (retval) | ||
302 | return retval; | ||
303 | suspend_mode = 1; | 292 | suspend_mode = 1; |
304 | |||
305 | retval = pm_send_all(PM_RESUME, (void *) 0); | ||
306 | } | 293 | } |
307 | return retval; | 294 | return 0; |
308 | } | 295 | } |
309 | 296 | ||
310 | 297 | ||
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c index d4438ef296d8..d7e92bfb8f66 100644 --- a/arch/x86/kernel/apm_32.c +++ b/arch/x86/kernel/apm_32.c | |||
@@ -1189,19 +1189,6 @@ static int suspend(int vetoable) | |||
1189 | int err; | 1189 | int err; |
1190 | struct apm_user *as; | 1190 | struct apm_user *as; |
1191 | 1191 | ||
1192 | if (pm_send_all(PM_SUSPEND, (void *)3)) { | ||
1193 | /* Vetoed */ | ||
1194 | if (vetoable) { | ||
1195 | if (apm_info.connection_version > 0x100) | ||
1196 | set_system_power_state(APM_STATE_REJECT); | ||
1197 | err = -EBUSY; | ||
1198 | ignore_sys_suspend = 0; | ||
1199 | printk(KERN_WARNING "apm: suspend was vetoed.\n"); | ||
1200 | goto out; | ||
1201 | } | ||
1202 | printk(KERN_CRIT "apm: suspend was vetoed, but suspending anyway.\n"); | ||
1203 | } | ||
1204 | |||
1205 | device_suspend(PMSG_SUSPEND); | 1192 | device_suspend(PMSG_SUSPEND); |
1206 | local_irq_disable(); | 1193 | local_irq_disable(); |
1207 | device_power_down(PMSG_SUSPEND); | 1194 | device_power_down(PMSG_SUSPEND); |
@@ -1224,7 +1211,6 @@ static int suspend(int vetoable) | |||
1224 | device_power_up(); | 1211 | device_power_up(); |
1225 | local_irq_enable(); | 1212 | local_irq_enable(); |
1226 | device_resume(); | 1213 | device_resume(); |
1227 | pm_send_all(PM_RESUME, (void *)0); | ||
1228 | queue_event(APM_NORMAL_RESUME, NULL); | 1214 | queue_event(APM_NORMAL_RESUME, NULL); |
1229 | out: | 1215 | out: |
1230 | spin_lock(&user_list_lock); | 1216 | spin_lock(&user_list_lock); |
@@ -1337,7 +1323,6 @@ static void check_events(void) | |||
1337 | if ((event != APM_NORMAL_RESUME) | 1323 | if ((event != APM_NORMAL_RESUME) |
1338 | || (ignore_normal_resume == 0)) { | 1324 | || (ignore_normal_resume == 0)) { |
1339 | device_resume(); | 1325 | device_resume(); |
1340 | pm_send_all(PM_RESUME, (void *)0); | ||
1341 | queue_event(event, NULL); | 1326 | queue_event(event, NULL); |
1342 | } | 1327 | } |
1343 | ignore_normal_resume = 0; | 1328 | ignore_normal_resume = 0; |