From: Russell King Date: Tue, 15 May 2007 10:22:48 +0000 (+0100) Subject: [ARM] pxa: Fix PXA27x suspend type validation, remove pxa_pm_prepare() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=88dfe98c688e1700a4a9f73f8b7d570f4f52170d;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [ARM] pxa: Fix PXA27x suspend type validation, remove pxa_pm_prepare() pxa_pm_prepare() tried to validate the suspend method type. As noted in previous commits: eb9289eb20df6b54214c45ac7c6bf5179a149026 9c372d06ce9ddf65e1393f9ea22a6d6bd5f96b42 e8c9c502690efd24b7055bf608e7a3c34216848b the checking of the suspend type in the 'prepare' method is the wrong place to do this; use the 'valid' method instead. This means that pxa_pm_prepare() can be entirely removed. Signed-off-by: Russell King --- diff --git a/arch/arm/common/sharpsl_pm.c b/arch/arm/common/sharpsl_pm.c index 62cb50816cc6..111a7fa5debe 100644 --- a/arch/arm/common/sharpsl_pm.c +++ b/arch/arm/common/sharpsl_pm.c @@ -766,7 +766,6 @@ static void sharpsl_apm_get_power_status(struct apm_power_info *info) } static struct pm_ops sharpsl_pm_ops = { - .prepare = pxa_pm_prepare, .enter = corgi_pxa_pm_enter, .valid = pm_valid_only_mem, }; diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c index 8560439ba0b9..fe29c6e03a4f 100644 --- a/arch/arm/mach-pxa/pxa25x.c +++ b/arch/arm/mach-pxa/pxa25x.c @@ -106,18 +106,6 @@ EXPORT_SYMBOL(get_lcdclk_frequency_10khz); #ifdef CONFIG_PM -int pxa_pm_prepare(suspend_state_t state) -{ - switch (state) { - case PM_SUSPEND_MEM: - break; - default: - return -EINVAL; - } - - return 0; -} - void pxa_cpu_pm_enter(suspend_state_t state) { extern void pxa_cpu_suspend(unsigned int); @@ -135,7 +123,6 @@ void pxa_cpu_pm_enter(suspend_state_t state) } static struct pm_ops pxa25x_pm_ops = { - .prepare = pxa_pm_prepare, .enter = pxa_pm_enter, .valid = pm_valid_only_mem, }; diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index be6ca7d3afa2..ac40fa5f7709 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c @@ -123,17 +123,6 @@ EXPORT_SYMBOL(get_lcdclk_frequency_10khz); #ifdef CONFIG_PM -int pxa_pm_prepare(suspend_state_t state) -{ - switch (state) { - case PM_SUSPEND_MEM: - case PM_SUSPEND_STANDBY: - return 0; - default: - return -EINVAL; - } -} - void pxa_cpu_pm_enter(suspend_state_t state) { extern void pxa_cpu_standby(void); @@ -163,10 +152,14 @@ void pxa_cpu_pm_enter(suspend_state_t state) } } +static int pxa27x_pm_valid(suspend_state_t state) +{ + return state == PM_SUSPEND_MEM || state == PM_SUSPEND_STANDBY; +} + static struct pm_ops pxa27x_pm_ops = { - .prepare = pxa_pm_prepare, .enter = pxa_pm_enter, - .valid = pm_valid_only_mem, + .valid = pxa27x_pm_valid, }; #endif