aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2007-10-18 06:04:41 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-18 17:37:18 -0400
commite6c5eb9541f2197a3ffab90b1c7a3250a9b51bf6 (patch)
treeac227415da22d4345f8e72a6a8e781757b6ce85a /kernel/power
parent26398a70ea35f153feb799fa850c71685667712b (diff)
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>
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/main.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c
index 854bf0811d40..7d09a9894947 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -58,13 +58,6 @@ int suspend_valid_only_mem(suspend_state_t state)
58 return state == PM_SUSPEND_MEM; 58 return state == PM_SUSPEND_MEM;
59} 59}
60 60
61
62static inline void pm_finish(suspend_state_t state)
63{
64 if (suspend_ops->finish)
65 suspend_ops->finish(state);
66}
67
68/** 61/**
69 * suspend_prepare - Do prep work before entering low-power state. 62 * suspend_prepare - Do prep work before entering low-power state.
70 * 63 *
@@ -171,7 +164,7 @@ int suspend_devices_and_enter(suspend_state_t state)
171 goto Resume_console; 164 goto Resume_console;
172 } 165 }
173 if (suspend_ops->prepare) { 166 if (suspend_ops->prepare) {
174 error = suspend_ops->prepare(state); 167 error = suspend_ops->prepare();
175 if (error) 168 if (error)
176 goto Resume_devices; 169 goto Resume_devices;
177 } 170 }
@@ -180,7 +173,8 @@ int suspend_devices_and_enter(suspend_state_t state)
180 suspend_enter(state); 173 suspend_enter(state);
181 174
182 enable_nonboot_cpus(); 175 enable_nonboot_cpus();
183 pm_finish(state); 176 if (suspend_ops->finish)
177 suspend_ops->finish();
184 Resume_devices: 178 Resume_devices:
185 device_resume(); 179 device_resume();
186 Resume_console: 180 Resume_console: