aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
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 /arch/arm
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 'arch/arm')
-rw-r--r--arch/arm/mach-omap1/pm.c20
-rw-r--r--arch/arm/mach-omap2/pm.c20
2 files changed, 6 insertions, 34 deletions
diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c
index 8db38dd247a4..3bf01e28df33 100644
--- a/arch/arm/mach-omap1/pm.c
+++ b/arch/arm/mach-omap1/pm.c
@@ -599,27 +599,15 @@ static void (*saved_idle)(void) = NULL;
599 599
600/* 600/*
601 * omap_pm_prepare - Do preliminary suspend work. 601 * omap_pm_prepare - Do preliminary suspend work.
602 * @state: suspend state we're entering.
603 * 602 *
604 */ 603 */
605static int omap_pm_prepare(suspend_state_t state) 604static int omap_pm_prepare(void)
606{ 605{
607 int error = 0;
608
609 /* We cannot sleep in idle until we have resumed */ 606 /* We cannot sleep in idle until we have resumed */
610 saved_idle = pm_idle; 607 saved_idle = pm_idle;
611 pm_idle = NULL; 608 pm_idle = NULL;
612 609
613 switch (state) 610 return 0;
614 {
615 case PM_SUSPEND_STANDBY:
616 case PM_SUSPEND_MEM:
617 break;
618 default:
619 return -EINVAL;
620 }
621
622 return error;
623} 611}
624 612
625 613
@@ -647,16 +635,14 @@ static int omap_pm_enter(suspend_state_t state)
647 635
648/** 636/**
649 * omap_pm_finish - Finish up suspend sequence. 637 * omap_pm_finish - Finish up suspend sequence.
650 * @state: State we're coming out of.
651 * 638 *
652 * This is called after we wake back up (or if entering the sleep state 639 * This is called after we wake back up (or if entering the sleep state
653 * failed). 640 * failed).
654 */ 641 */
655 642
656static int omap_pm_finish(suspend_state_t state) 643static void omap_pm_finish(void)
657{ 644{
658 pm_idle = saved_idle; 645 pm_idle = saved_idle;
659 return 0;
660} 646}
661 647
662 648
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index 9aaa7a2633e8..baf7d82b458b 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -70,25 +70,12 @@ void omap2_pm_idle(void)
70 local_irq_enable(); 70 local_irq_enable();
71} 71}
72 72
73static int omap2_pm_prepare(suspend_state_t state) 73static int omap2_pm_prepare(void)
74{ 74{
75 int error = 0;
76
77 /* We cannot sleep in idle until we have resumed */ 75 /* We cannot sleep in idle until we have resumed */
78 saved_idle = pm_idle; 76 saved_idle = pm_idle;
79 pm_idle = NULL; 77 pm_idle = NULL;
80 78 return 0;
81 switch (state)
82 {
83 case PM_SUSPEND_STANDBY:
84 case PM_SUSPEND_MEM:
85 break;
86
87 default:
88 return -EINVAL;
89 }
90
91 return error;
92} 79}
93 80
94#define INT0_WAKE_MASK (OMAP_IRQ_BIT(INT_24XX_GPIO_BANK1) | \ 81#define INT0_WAKE_MASK (OMAP_IRQ_BIT(INT_24XX_GPIO_BANK1) | \
@@ -356,10 +343,9 @@ static int omap2_pm_enter(suspend_state_t state)
356 return ret; 343 return ret;
357} 344}
358 345
359static int omap2_pm_finish(suspend_state_t state) 346static void omap2_pm_finish(void)
360{ 347{
361 pm_idle = saved_idle; 348 pm_idle = saved_idle;
362 return 0;
363} 349}
364 350
365static struct platform_suspend_ops omap_pm_ops = { 351static struct platform_suspend_ops omap_pm_ops = {