PM: Rework struct platform_suspend_ops

There is no reason why the .prepare() and .finish() methods in 'struct
platform_suspend_ops' should take any arguments, since architectures don't use
these methods' argument in any practically meaningful way (ie.  either the
target system sleep state is conveyed to the platform by .set_target(), or
there is only one suspend state supported and it is indicated to the PM core
by .valid(), or .prepare() and .finish() aren't defined at all).   There also
is no reason why .finish() should return any result.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: Len Brown <lenb@kernel.org>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Rafael J. Wysocki 2007-10-18 03:04:41 -07:00 committed by Linus Torvalds
parent 26398a70ea
commit e6c5eb9541
9 changed files with 49 additions and 125 deletions

View file

@ -58,13 +58,6 @@ int suspend_valid_only_mem(suspend_state_t state)
return state == PM_SUSPEND_MEM;
}
static inline void pm_finish(suspend_state_t state)
{
if (suspend_ops->finish)
suspend_ops->finish(state);
}
/**
* suspend_prepare - Do prep work before entering low-power state.
*
@ -171,7 +164,7 @@ int suspend_devices_and_enter(suspend_state_t state)
goto Resume_console;
}
if (suspend_ops->prepare) {
error = suspend_ops->prepare(state);
error = suspend_ops->prepare();
if (error)
goto Resume_devices;
}
@ -180,7 +173,8 @@ int suspend_devices_and_enter(suspend_state_t state)
suspend_enter(state);
enable_nonboot_cpus();
pm_finish(state);
if (suspend_ops->finish)
suspend_ops->finish();
Resume_devices:
device_resume();
Resume_console: