From e6c5eb9541f2197a3ffab90b1c7a3250a9b51bf6 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Thu, 18 Oct 2007 03:04:41 -0700 Subject: PM: Rework struct platform_suspend_ops MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Acked-by: Pavel Machek Cc: Len Brown Cc: Greg KH Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/blackfin/mach-common/pm.c | 53 ++++-------------------------------------- 1 file changed, 5 insertions(+), 48 deletions(-) (limited to 'arch/blackfin') diff --git a/arch/blackfin/mach-common/pm.c b/arch/blackfin/mach-common/pm.c index 6901891905c..dac51fb06f2 100644 --- a/arch/blackfin/mach-common/pm.c +++ b/arch/blackfin/mach-common/pm.c @@ -89,28 +89,15 @@ void bfin_pm_suspend_standby_enter(void) #endif /* CONFIG_PM_WAKEUP_GPIO_BY_SIC_IWR */ } - /* - * bfin_pm_prepare - Do preliminary suspend work. - * @state: suspend state we're entering. + * bfin_pm_valid - Tell the PM core that we only support the standby sleep + * state + * @state: suspend state we're checking. * */ -static int bfin_pm_prepare(suspend_state_t state) +static int bfin_pm_valid(suspend_state_t state) { - int error = 0; - - switch (state) { - case PM_SUSPEND_STANDBY: - break; - - case PM_SUSPEND_MEM: - return -ENOTSUPP; - - default: - return -EINVAL; - } - - return error; + return (state == PM_SUSPEND_STANDBY); } /* @@ -135,38 +122,8 @@ static int bfin_pm_enter(suspend_state_t state) return 0; } -/* - * bfin_pm_finish - Finish up suspend sequence. - * @state: State we're coming out of. - * - * This is called after we wake back up (or if entering the sleep state - * failed). - */ -static int bfin_pm_finish(suspend_state_t state) -{ - switch (state) { - case PM_SUSPEND_STANDBY: - break; - - case PM_SUSPEND_MEM: - return -ENOTSUPP; - - default: - return -EINVAL; - } - - return 0; -} - -static int bfin_pm_valid(suspend_state_t state) -{ - return (state == PM_SUSPEND_STANDBY); -} - struct platform_suspend_ops bfin_pm_ops = { - .prepare = bfin_pm_prepare, .enter = bfin_pm_enter, - .finish = bfin_pm_finish, .valid = bfin_pm_valid, }; -- cgit v1.2.3-18-g5258