diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2007-03-19 06:53:55 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-03-25 22:35:17 -0400 |
commit | 70b52b3869a31aab85241a1f998f9943a3905637 (patch) | |
tree | 3c6944c5545c206cc43b8c20f1b9fe150b7ac0e9 /drivers/macintosh/adb.c | |
parent | 17e638bc28f2fdc9c0d3eebfb80fce43827b8d12 (diff) |
[POWERPC] powermac: disallow pmu sleep notifiers from aborting sleep
Tracing through the code, no current PMU sleep notifier can abort sleep.
Since no new PMU sleep notifiers should be added, this patch simplifies the
code and removes the ability to abort sleep.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers/macintosh/adb.c')
-rw-r--r-- | drivers/macintosh/adb.c | 42 |
1 files changed, 9 insertions, 33 deletions
diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c index f729eebf771..adfea3c7c62 100644 --- a/drivers/macintosh/adb.c +++ b/drivers/macintosh/adb.c | |||
@@ -90,7 +90,7 @@ static int autopoll_devs; | |||
90 | int __adb_probe_sync; | 90 | int __adb_probe_sync; |
91 | 91 | ||
92 | #ifdef CONFIG_PM | 92 | #ifdef CONFIG_PM |
93 | static int adb_notify_sleep(struct pmu_sleep_notifier *self, int when); | 93 | static void adb_notify_sleep(struct pmu_sleep_notifier *self, int when); |
94 | static struct pmu_sleep_notifier adb_sleep_notifier = { | 94 | static struct pmu_sleep_notifier adb_sleep_notifier = { |
95 | adb_notify_sleep, | 95 | adb_notify_sleep, |
96 | SLEEP_LEVEL_ADB, | 96 | SLEEP_LEVEL_ADB, |
@@ -340,11 +340,9 @@ __initcall(adb_init); | |||
340 | /* | 340 | /* |
341 | * notify clients before sleep and reset bus afterwards | 341 | * notify clients before sleep and reset bus afterwards |
342 | */ | 342 | */ |
343 | int | 343 | void |
344 | adb_notify_sleep(struct pmu_sleep_notifier *self, int when) | 344 | adb_notify_sleep(struct pmu_sleep_notifier *self, int when) |
345 | { | 345 | { |
346 | int ret; | ||
347 | |||
348 | switch (when) { | 346 | switch (when) { |
349 | case PBOOK_SLEEP_REQUEST: | 347 | case PBOOK_SLEEP_REQUEST: |
350 | adb_got_sleep = 1; | 348 | adb_got_sleep = 1; |
@@ -353,22 +351,8 @@ adb_notify_sleep(struct pmu_sleep_notifier *self, int when) | |||
353 | /* Stop autopoll */ | 351 | /* Stop autopoll */ |
354 | if (adb_controller->autopoll) | 352 | if (adb_controller->autopoll) |
355 | adb_controller->autopoll(0); | 353 | adb_controller->autopoll(0); |
356 | ret = blocking_notifier_call_chain(&adb_client_list, | 354 | blocking_notifier_call_chain(&adb_client_list, |
357 | ADB_MSG_POWERDOWN, NULL); | 355 | ADB_MSG_POWERDOWN, NULL); |
358 | if (ret & NOTIFY_STOP_MASK) { | ||
359 | up(&adb_probe_mutex); | ||
360 | return PBOOK_SLEEP_REFUSE; | ||
361 | } | ||
362 | break; | ||
363 | case PBOOK_SLEEP_REJECT: | ||
364 | if (adb_got_sleep) { | ||
365 | adb_got_sleep = 0; | ||
366 | up(&adb_probe_mutex); | ||
367 | adb_reset_bus(); | ||
368 | } | ||
369 | break; | ||
370 | |||
371 | case PBOOK_SLEEP_NOW: | ||
372 | break; | 356 | break; |
373 | case PBOOK_WAKE: | 357 | case PBOOK_WAKE: |
374 | adb_got_sleep = 0; | 358 | adb_got_sleep = 0; |
@@ -376,14 +360,13 @@ adb_notify_sleep(struct pmu_sleep_notifier *self, int when) | |||
376 | adb_reset_bus(); | 360 | adb_reset_bus(); |
377 | break; | 361 | break; |
378 | } | 362 | } |
379 | return PBOOK_SLEEP_OK; | ||
380 | } | 363 | } |
381 | #endif /* CONFIG_PM */ | 364 | #endif /* CONFIG_PM */ |
382 | 365 | ||
383 | static int | 366 | static int |
384 | do_adb_reset_bus(void) | 367 | do_adb_reset_bus(void) |
385 | { | 368 | { |
386 | int ret, nret; | 369 | int ret; |
387 | 370 | ||
388 | if (adb_controller == NULL) | 371 | if (adb_controller == NULL) |
389 | return -ENXIO; | 372 | return -ENXIO; |
@@ -391,13 +374,8 @@ do_adb_reset_bus(void) | |||
391 | if (adb_controller->autopoll) | 374 | if (adb_controller->autopoll) |
392 | adb_controller->autopoll(0); | 375 | adb_controller->autopoll(0); |
393 | 376 | ||
394 | nret = blocking_notifier_call_chain(&adb_client_list, | 377 | blocking_notifier_call_chain(&adb_client_list, |
395 | ADB_MSG_PRE_RESET, NULL); | 378 | ADB_MSG_PRE_RESET, NULL); |
396 | if (nret & NOTIFY_STOP_MASK) { | ||
397 | if (adb_controller->autopoll) | ||
398 | adb_controller->autopoll(autopoll_devs); | ||
399 | return -EBUSY; | ||
400 | } | ||
401 | 379 | ||
402 | if (sleepy_trackpad) { | 380 | if (sleepy_trackpad) { |
403 | /* Let the trackpad settle down */ | 381 | /* Let the trackpad settle down */ |
@@ -427,10 +405,8 @@ do_adb_reset_bus(void) | |||
427 | } | 405 | } |
428 | up(&adb_handler_sem); | 406 | up(&adb_handler_sem); |
429 | 407 | ||
430 | nret = blocking_notifier_call_chain(&adb_client_list, | 408 | blocking_notifier_call_chain(&adb_client_list, |
431 | ADB_MSG_POST_RESET, NULL); | 409 | ADB_MSG_POST_RESET, NULL); |
432 | if (nret & NOTIFY_STOP_MASK) | ||
433 | return -EBUSY; | ||
434 | 410 | ||
435 | return ret; | 411 | return ret; |
436 | } | 412 | } |