X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=arch%2Farm%2Fmach-pnx4008%2Fpm.c;h=40116d2543496c284af73a8fde5d94c789951cd5;hb=3155f7f23f7865e64f7eb14e226a2dff8197e51f;hp=3649cd3dfc9af4abe0ffe07cf1bbd66dc352aef8;hpb=c9ab09710ecb071031b0a04f3f9d7e686c0a75e0;p=linux-2.6 diff --git a/arch/arm/mach-pnx4008/pm.c b/arch/arm/mach-pnx4008/pm.c index 3649cd3dfc..40116d2543 100644 --- a/arch/arm/mach-pnx4008/pm.c +++ b/arch/arm/mach-pnx4008/pm.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include @@ -107,50 +107,19 @@ static int pnx4008_pm_enter(suspend_state_t state) case PM_SUSPEND_MEM: pnx4008_suspend(); break; - case PM_SUSPEND_DISK: - return -ENOTSUPP; - default: - return -EINVAL; } return 0; } -/* - * Called after processes are frozen, but before we shut down devices. - */ -static int pnx4008_pm_prepare(suspend_state_t state) +static int pnx4008_pm_valid(suspend_state_t state) { - switch (state) { - case PM_SUSPEND_STANDBY: - case PM_SUSPEND_MEM: - break; - - case PM_SUSPEND_DISK: - return -ENOTSUPP; - break; - - default: - return -EINVAL; - break; - } - return 0; -} - -/* - * Called after devices are re-setup, but before processes are thawed. - */ -static int pnx4008_pm_finish(suspend_state_t state) -{ - return 0; + return (state == PM_SUSPEND_STANDBY) || + (state == PM_SUSPEND_MEM); } -/* - * Set to PM_DISK_FIRMWARE so we can quickly veto suspend-to-disk. - */ -static struct pm_ops pnx4008_pm_ops = { - .prepare = pnx4008_pm_prepare, +static struct platform_suspend_ops pnx4008_pm_ops = { .enter = pnx4008_pm_enter, - .finish = pnx4008_pm_finish, + .valid = pnx4008_pm_valid, }; static int __init pnx4008_pm_init(void) @@ -177,7 +146,7 @@ static int __init pnx4008_pm_init(void) return -ENOMEM; } - pm_set_ops(&pnx4008_pm_ops); + suspend_set_ops(&pnx4008_pm_ops); return 0; }