diff options
author | Lionel Debroux <lionel_debroux@yahoo.fr> | 2010-11-16 08:14:02 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2010-11-16 08:14:02 -0500 |
commit | 2f55ac072f5344519348c0c94b3d2f4cca46847b (patch) | |
tree | f3d544ab2812503b12a205b2515111a796638ffb | |
parent | acc2472ed33fc5e72482cc3b3b846077d97c2f8b (diff) |
suspend: constify platform_suspend_ops
While at it, fix two checkpatch errors.
Several non-const struct instances constified by this patch were added after
the introduction of platform_suspend_ops in checkpatch.pl's list of "should
be const" structs (79404849e90a41ea2109bd0e2f7c7164b0c4ce73).
Patch against mainline.
Inspired by hunks of the grsecurity patch, updated for newer kernels.
Signed-off-by: Lionel Debroux <lionel_debroux@yahoo.fr>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
29 files changed, 32 insertions, 32 deletions
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c index dafbacc25eb1..ea53f4d9b283 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c | |||
@@ -301,7 +301,7 @@ static void at91_pm_end(void) | |||
301 | } | 301 | } |
302 | 302 | ||
303 | 303 | ||
304 | static struct platform_suspend_ops at91_pm_ops ={ | 304 | static const struct platform_suspend_ops at91_pm_ops = { |
305 | .valid = at91_pm_valid_state, | 305 | .valid = at91_pm_valid_state, |
306 | .begin = at91_pm_begin, | 306 | .begin = at91_pm_begin, |
307 | .enter = at91_pm_enter, | 307 | .enter = at91_pm_enter, |
diff --git a/arch/arm/mach-davinci/pm.c b/arch/arm/mach-davinci/pm.c index fab953b43dea..1bd73a04be20 100644 --- a/arch/arm/mach-davinci/pm.c +++ b/arch/arm/mach-davinci/pm.c | |||
@@ -110,7 +110,7 @@ static int davinci_pm_enter(suspend_state_t state) | |||
110 | return ret; | 110 | return ret; |
111 | } | 111 | } |
112 | 112 | ||
113 | static struct platform_suspend_ops davinci_pm_ops = { | 113 | static const struct platform_suspend_ops davinci_pm_ops = { |
114 | .enter = davinci_pm_enter, | 114 | .enter = davinci_pm_enter, |
115 | .valid = suspend_valid_only_mem, | 115 | .valid = suspend_valid_only_mem, |
116 | }; | 116 | }; |
diff --git a/arch/arm/mach-imx/pm-imx27.c b/arch/arm/mach-imx/pm-imx27.c index afc17ce0bb54..2153ca71bb82 100644 --- a/arch/arm/mach-imx/pm-imx27.c +++ b/arch/arm/mach-imx/pm-imx27.c | |||
@@ -32,7 +32,7 @@ static int mx27_suspend_enter(suspend_state_t state) | |||
32 | return 0; | 32 | return 0; |
33 | } | 33 | } |
34 | 34 | ||
35 | static struct platform_suspend_ops mx27_suspend_ops = { | 35 | static const struct platform_suspend_ops mx27_suspend_ops = { |
36 | .enter = mx27_suspend_enter, | 36 | .enter = mx27_suspend_enter, |
37 | .valid = suspend_valid_only_mem, | 37 | .valid = suspend_valid_only_mem, |
38 | }; | 38 | }; |
diff --git a/arch/arm/mach-lpc32xx/pm.c b/arch/arm/mach-lpc32xx/pm.c index a6e2aed9a49f..e76d41bb7056 100644 --- a/arch/arm/mach-lpc32xx/pm.c +++ b/arch/arm/mach-lpc32xx/pm.c | |||
@@ -123,7 +123,7 @@ static int lpc32xx_pm_enter(suspend_state_t state) | |||
123 | return 0; | 123 | return 0; |
124 | } | 124 | } |
125 | 125 | ||
126 | static struct platform_suspend_ops lpc32xx_pm_ops = { | 126 | static const struct platform_suspend_ops lpc32xx_pm_ops = { |
127 | .valid = suspend_valid_only_mem, | 127 | .valid = suspend_valid_only_mem, |
128 | .enter = lpc32xx_pm_enter, | 128 | .enter = lpc32xx_pm_enter, |
129 | }; | 129 | }; |
diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c index b1d3f9fade23..4cf3b67dd998 100644 --- a/arch/arm/mach-omap1/pm.c +++ b/arch/arm/mach-omap1/pm.c | |||
@@ -647,7 +647,7 @@ static struct irqaction omap_wakeup_irq = { | |||
647 | 647 | ||
648 | 648 | ||
649 | 649 | ||
650 | static struct platform_suspend_ops omap_pm_ops ={ | 650 | static const struct platform_suspend_ops omap_pm_ops = { |
651 | .prepare = omap_pm_prepare, | 651 | .prepare = omap_pm_prepare, |
652 | .enter = omap_pm_enter, | 652 | .enter = omap_pm_enter, |
653 | .finish = omap_pm_finish, | 653 | .finish = omap_pm_finish, |
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c index a40457d81927..aa9764eeb941 100644 --- a/arch/arm/mach-omap2/pm24xx.c +++ b/arch/arm/mach-omap2/pm24xx.c | |||
@@ -326,7 +326,7 @@ static void omap2_pm_finish(void) | |||
326 | enable_hlt(); | 326 | enable_hlt(); |
327 | } | 327 | } |
328 | 328 | ||
329 | static struct platform_suspend_ops omap_pm_ops = { | 329 | static const struct platform_suspend_ops omap_pm_ops = { |
330 | .prepare = omap2_pm_prepare, | 330 | .prepare = omap2_pm_prepare, |
331 | .enter = omap2_pm_enter, | 331 | .enter = omap2_pm_enter, |
332 | .finish = omap2_pm_finish, | 332 | .finish = omap2_pm_finish, |
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 75c0cd13ad8e..4000c3c8bbd5 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c | |||
@@ -594,7 +594,7 @@ static void omap3_pm_end(void) | |||
594 | return; | 594 | return; |
595 | } | 595 | } |
596 | 596 | ||
597 | static struct platform_suspend_ops omap_pm_ops = { | 597 | static const struct platform_suspend_ops omap_pm_ops = { |
598 | .begin = omap3_pm_begin, | 598 | .begin = omap3_pm_begin, |
599 | .end = omap3_pm_end, | 599 | .end = omap3_pm_end, |
600 | .prepare = omap3_pm_prepare, | 600 | .prepare = omap3_pm_prepare, |
diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c index 54544b4fc76b..dc8b1ef9f84c 100644 --- a/arch/arm/mach-omap2/pm44xx.c +++ b/arch/arm/mach-omap2/pm44xx.c | |||
@@ -75,7 +75,7 @@ static void omap4_pm_end(void) | |||
75 | return; | 75 | return; |
76 | } | 76 | } |
77 | 77 | ||
78 | static struct platform_suspend_ops omap_pm_ops = { | 78 | static const struct platform_suspend_ops omap_pm_ops = { |
79 | .begin = omap4_pm_begin, | 79 | .begin = omap4_pm_begin, |
80 | .end = omap4_pm_end, | 80 | .end = omap4_pm_end, |
81 | .prepare = omap4_pm_prepare, | 81 | .prepare = omap4_pm_prepare, |
diff --git a/arch/arm/mach-pnx4008/pm.c b/arch/arm/mach-pnx4008/pm.c index ee3c29c57ae3..f3e60a049f98 100644 --- a/arch/arm/mach-pnx4008/pm.c +++ b/arch/arm/mach-pnx4008/pm.c | |||
@@ -119,7 +119,7 @@ static int pnx4008_pm_valid(suspend_state_t state) | |||
119 | (state == PM_SUSPEND_MEM); | 119 | (state == PM_SUSPEND_MEM); |
120 | } | 120 | } |
121 | 121 | ||
122 | static struct platform_suspend_ops pnx4008_pm_ops = { | 122 | static const struct platform_suspend_ops pnx4008_pm_ops = { |
123 | .enter = pnx4008_pm_enter, | 123 | .enter = pnx4008_pm_enter, |
124 | .valid = pnx4008_pm_valid, | 124 | .valid = pnx4008_pm_valid, |
125 | }; | 125 | }; |
diff --git a/arch/arm/mach-pxa/pm.c b/arch/arm/mach-pxa/pm.c index 166c15f62916..978e1b289544 100644 --- a/arch/arm/mach-pxa/pm.c +++ b/arch/arm/mach-pxa/pm.c | |||
@@ -96,7 +96,7 @@ void pxa_pm_finish(void) | |||
96 | pxa_cpu_pm_fns->finish(); | 96 | pxa_cpu_pm_fns->finish(); |
97 | } | 97 | } |
98 | 98 | ||
99 | static struct platform_suspend_ops pxa_pm_ops = { | 99 | static const struct platform_suspend_ops pxa_pm_ops = { |
100 | .valid = pxa_pm_valid, | 100 | .valid = pxa_pm_valid, |
101 | .enter = pxa_pm_enter, | 101 | .enter = pxa_pm_enter, |
102 | .prepare = pxa_pm_prepare, | 102 | .prepare = pxa_pm_prepare, |
diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c index 8fed027b12dc..02874e96ec72 100644 --- a/arch/arm/mach-pxa/sharpsl_pm.c +++ b/arch/arm/mach-pxa/sharpsl_pm.c | |||
@@ -868,7 +868,7 @@ static void sharpsl_apm_get_power_status(struct apm_power_info *info) | |||
868 | } | 868 | } |
869 | 869 | ||
870 | #ifdef CONFIG_PM | 870 | #ifdef CONFIG_PM |
871 | static struct platform_suspend_ops sharpsl_pm_ops = { | 871 | static const struct platform_suspend_ops sharpsl_pm_ops = { |
872 | .prepare = pxa_pm_prepare, | 872 | .prepare = pxa_pm_prepare, |
873 | .finish = pxa_pm_finish, | 873 | .finish = pxa_pm_finish, |
874 | .enter = corgi_pxa_pm_enter, | 874 | .enter = corgi_pxa_pm_enter, |
diff --git a/arch/arm/mach-sa1100/pm.c b/arch/arm/mach-sa1100/pm.c index c83fdc80edfd..ab9fc4470d36 100644 --- a/arch/arm/mach-sa1100/pm.c +++ b/arch/arm/mach-sa1100/pm.c | |||
@@ -120,7 +120,7 @@ unsigned long sleep_phys_sp(void *sp) | |||
120 | return virt_to_phys(sp); | 120 | return virt_to_phys(sp); |
121 | } | 121 | } |
122 | 122 | ||
123 | static struct platform_suspend_ops sa11x0_pm_ops = { | 123 | static const struct platform_suspend_ops sa11x0_pm_ops = { |
124 | .enter = sa11x0_pm_enter, | 124 | .enter = sa11x0_pm_enter, |
125 | .valid = suspend_valid_only_mem, | 125 | .valid = suspend_valid_only_mem, |
126 | }; | 126 | }; |
diff --git a/arch/arm/plat-samsung/pm.c b/arch/arm/plat-samsung/pm.c index 27cfca597699..5bf3f2f09e74 100644 --- a/arch/arm/plat-samsung/pm.c +++ b/arch/arm/plat-samsung/pm.c | |||
@@ -355,7 +355,7 @@ static void s3c_pm_finish(void) | |||
355 | s3c_pm_check_cleanup(); | 355 | s3c_pm_check_cleanup(); |
356 | } | 356 | } |
357 | 357 | ||
358 | static struct platform_suspend_ops s3c_pm_ops = { | 358 | static const struct platform_suspend_ops s3c_pm_ops = { |
359 | .enter = s3c_pm_enter, | 359 | .enter = s3c_pm_enter, |
360 | .prepare = s3c_pm_prepare, | 360 | .prepare = s3c_pm_prepare, |
361 | .finish = s3c_pm_finish, | 361 | .finish = s3c_pm_finish, |
diff --git a/arch/avr32/mach-at32ap/pm.c b/arch/avr32/mach-at32ap/pm.c index f021edfeaab0..32d680eb6f48 100644 --- a/arch/avr32/mach-at32ap/pm.c +++ b/arch/avr32/mach-at32ap/pm.c | |||
@@ -176,7 +176,7 @@ out: | |||
176 | return 0; | 176 | return 0; |
177 | } | 177 | } |
178 | 178 | ||
179 | static struct platform_suspend_ops avr32_pm_ops = { | 179 | static const struct platform_suspend_ops avr32_pm_ops = { |
180 | .valid = avr32_pm_valid_state, | 180 | .valid = avr32_pm_valid_state, |
181 | .enter = avr32_pm_enter, | 181 | .enter = avr32_pm_enter, |
182 | }; | 182 | }; |
diff --git a/arch/blackfin/mach-common/pm.c b/arch/blackfin/mach-common/pm.c index 80884b136a0c..745af2d96553 100644 --- a/arch/blackfin/mach-common/pm.c +++ b/arch/blackfin/mach-common/pm.c | |||
@@ -233,7 +233,7 @@ static int bfin_pm_enter(suspend_state_t state) | |||
233 | return 0; | 233 | return 0; |
234 | } | 234 | } |
235 | 235 | ||
236 | struct platform_suspend_ops bfin_pm_ops = { | 236 | static const struct platform_suspend_ops bfin_pm_ops = { |
237 | .enter = bfin_pm_enter, | 237 | .enter = bfin_pm_enter, |
238 | .valid = bfin_pm_valid, | 238 | .valid = bfin_pm_valid, |
239 | }; | 239 | }; |
diff --git a/arch/mips/alchemy/devboards/pm.c b/arch/mips/alchemy/devboards/pm.c index 4bbd3133e451..acaf91b5e461 100644 --- a/arch/mips/alchemy/devboards/pm.c +++ b/arch/mips/alchemy/devboards/pm.c | |||
@@ -110,7 +110,7 @@ static void db1x_pm_end(void) | |||
110 | 110 | ||
111 | } | 111 | } |
112 | 112 | ||
113 | static struct platform_suspend_ops db1x_pm_ops = { | 113 | static const struct platform_suspend_ops db1x_pm_ops = { |
114 | .valid = suspend_valid_only_mem, | 114 | .valid = suspend_valid_only_mem, |
115 | .begin = db1x_pm_begin, | 115 | .begin = db1x_pm_begin, |
116 | .enter = db1x_pm_enter, | 116 | .enter = db1x_pm_enter, |
diff --git a/arch/mips/jz4740/pm.c b/arch/mips/jz4740/pm.c index a9994585424d..902d5b50124c 100644 --- a/arch/mips/jz4740/pm.c +++ b/arch/mips/jz4740/pm.c | |||
@@ -42,7 +42,7 @@ static int jz4740_pm_enter(suspend_state_t state) | |||
42 | return 0; | 42 | return 0; |
43 | } | 43 | } |
44 | 44 | ||
45 | static struct platform_suspend_ops jz4740_pm_ops = { | 45 | static const struct platform_suspend_ops jz4740_pm_ops = { |
46 | .valid = suspend_valid_only_mem, | 46 | .valid = suspend_valid_only_mem, |
47 | .enter = jz4740_pm_enter, | 47 | .enter = jz4740_pm_enter, |
48 | }; | 48 | }; |
diff --git a/arch/mips/loongson/common/pm.c b/arch/mips/loongson/common/pm.c index 6c1fd9001712..f55e07aee071 100644 --- a/arch/mips/loongson/common/pm.c +++ b/arch/mips/loongson/common/pm.c | |||
@@ -147,7 +147,7 @@ static int loongson_pm_valid_state(suspend_state_t state) | |||
147 | } | 147 | } |
148 | } | 148 | } |
149 | 149 | ||
150 | static struct platform_suspend_ops loongson_pm_ops = { | 150 | static const struct platform_suspend_ops loongson_pm_ops = { |
151 | .valid = loongson_pm_valid_state, | 151 | .valid = loongson_pm_valid_state, |
152 | .enter = loongson_pm_enter, | 152 | .enter = loongson_pm_enter, |
153 | }; | 153 | }; |
diff --git a/arch/powerpc/platforms/52xx/lite5200_pm.c b/arch/powerpc/platforms/52xx/lite5200_pm.c index 80234e5921f5..eda0fc2a3914 100644 --- a/arch/powerpc/platforms/52xx/lite5200_pm.c +++ b/arch/powerpc/platforms/52xx/lite5200_pm.c | |||
@@ -232,7 +232,7 @@ static void lite5200_pm_end(void) | |||
232 | lite5200_pm_target_state = PM_SUSPEND_ON; | 232 | lite5200_pm_target_state = PM_SUSPEND_ON; |
233 | } | 233 | } |
234 | 234 | ||
235 | static struct platform_suspend_ops lite5200_pm_ops = { | 235 | static const struct platform_suspend_ops lite5200_pm_ops = { |
236 | .valid = lite5200_pm_valid, | 236 | .valid = lite5200_pm_valid, |
237 | .begin = lite5200_pm_begin, | 237 | .begin = lite5200_pm_begin, |
238 | .prepare = lite5200_pm_prepare, | 238 | .prepare = lite5200_pm_prepare, |
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pm.c b/arch/powerpc/platforms/52xx/mpc52xx_pm.c index 568cef636275..8310e8b5b57f 100644 --- a/arch/powerpc/platforms/52xx/mpc52xx_pm.c +++ b/arch/powerpc/platforms/52xx/mpc52xx_pm.c | |||
@@ -186,7 +186,7 @@ void mpc52xx_pm_finish(void) | |||
186 | iounmap(mbar); | 186 | iounmap(mbar); |
187 | } | 187 | } |
188 | 188 | ||
189 | static struct platform_suspend_ops mpc52xx_pm_ops = { | 189 | static const struct platform_suspend_ops mpc52xx_pm_ops = { |
190 | .valid = mpc52xx_pm_valid, | 190 | .valid = mpc52xx_pm_valid, |
191 | .prepare = mpc52xx_pm_prepare, | 191 | .prepare = mpc52xx_pm_prepare, |
192 | .enter = mpc52xx_pm_enter, | 192 | .enter = mpc52xx_pm_enter, |
diff --git a/arch/powerpc/platforms/83xx/suspend.c b/arch/powerpc/platforms/83xx/suspend.c index 75ae77f1af6a..fd4f2f2f19e6 100644 --- a/arch/powerpc/platforms/83xx/suspend.c +++ b/arch/powerpc/platforms/83xx/suspend.c | |||
@@ -311,7 +311,7 @@ static int mpc83xx_is_pci_agent(void) | |||
311 | return ret; | 311 | return ret; |
312 | } | 312 | } |
313 | 313 | ||
314 | static struct platform_suspend_ops mpc83xx_suspend_ops = { | 314 | static const struct platform_suspend_ops mpc83xx_suspend_ops = { |
315 | .valid = mpc83xx_suspend_valid, | 315 | .valid = mpc83xx_suspend_valid, |
316 | .begin = mpc83xx_suspend_begin, | 316 | .begin = mpc83xx_suspend_begin, |
317 | .enter = mpc83xx_suspend_enter, | 317 | .enter = mpc83xx_suspend_enter, |
diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/pseries/suspend.c index ed72098bb4e3..a8ca289ff267 100644 --- a/arch/powerpc/platforms/pseries/suspend.c +++ b/arch/powerpc/platforms/pseries/suspend.c | |||
@@ -153,7 +153,7 @@ static struct sysdev_class suspend_sysdev_class = { | |||
153 | .name = "power", | 153 | .name = "power", |
154 | }; | 154 | }; |
155 | 155 | ||
156 | static struct platform_suspend_ops pseries_suspend_ops = { | 156 | static const struct platform_suspend_ops pseries_suspend_ops = { |
157 | .valid = suspend_valid_only_mem, | 157 | .valid = suspend_valid_only_mem, |
158 | .begin = pseries_suspend_begin, | 158 | .begin = pseries_suspend_begin, |
159 | .prepare_late = pseries_prepare_late, | 159 | .prepare_late = pseries_prepare_late, |
diff --git a/arch/powerpc/sysdev/fsl_pmc.c b/arch/powerpc/sysdev/fsl_pmc.c index 44de8559c975..e9381bfefb21 100644 --- a/arch/powerpc/sysdev/fsl_pmc.c +++ b/arch/powerpc/sysdev/fsl_pmc.c | |||
@@ -53,7 +53,7 @@ static int pmc_suspend_valid(suspend_state_t state) | |||
53 | return 1; | 53 | return 1; |
54 | } | 54 | } |
55 | 55 | ||
56 | static struct platform_suspend_ops pmc_suspend_ops = { | 56 | static const struct platform_suspend_ops pmc_suspend_ops = { |
57 | .valid = pmc_suspend_valid, | 57 | .valid = pmc_suspend_valid, |
58 | .enter = pmc_suspend_enter, | 58 | .enter = pmc_suspend_enter, |
59 | }; | 59 | }; |
diff --git a/arch/sh/boards/mach-hp6xx/pm.c b/arch/sh/boards/mach-hp6xx/pm.c index 4499a3749d40..adc9b4bba828 100644 --- a/arch/sh/boards/mach-hp6xx/pm.c +++ b/arch/sh/boards/mach-hp6xx/pm.c | |||
@@ -143,7 +143,7 @@ static int hp6x0_pm_enter(suspend_state_t state) | |||
143 | return 0; | 143 | return 0; |
144 | } | 144 | } |
145 | 145 | ||
146 | static struct platform_suspend_ops hp6x0_pm_ops = { | 146 | static const struct platform_suspend_ops hp6x0_pm_ops = { |
147 | .enter = hp6x0_pm_enter, | 147 | .enter = hp6x0_pm_enter, |
148 | .valid = suspend_valid_only_mem, | 148 | .valid = suspend_valid_only_mem, |
149 | }; | 149 | }; |
diff --git a/arch/sh/kernel/cpu/shmobile/pm.c b/arch/sh/kernel/cpu/shmobile/pm.c index e55968712706..a6f95ae4aae7 100644 --- a/arch/sh/kernel/cpu/shmobile/pm.c +++ b/arch/sh/kernel/cpu/shmobile/pm.c | |||
@@ -141,7 +141,7 @@ static int sh_pm_enter(suspend_state_t state) | |||
141 | return 0; | 141 | return 0; |
142 | } | 142 | } |
143 | 143 | ||
144 | static struct platform_suspend_ops sh_pm_ops = { | 144 | static const struct platform_suspend_ops sh_pm_ops = { |
145 | .enter = sh_pm_enter, | 145 | .enter = sh_pm_enter, |
146 | .valid = suspend_valid_only_mem, | 146 | .valid = suspend_valid_only_mem, |
147 | }; | 147 | }; |
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 5149c9bf7015..ba1caf724a16 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c | |||
@@ -319,7 +319,7 @@ static int acpi_suspend_state_valid(suspend_state_t pm_state) | |||
319 | } | 319 | } |
320 | } | 320 | } |
321 | 321 | ||
322 | static struct platform_suspend_ops acpi_suspend_ops = { | 322 | static const struct platform_suspend_ops acpi_suspend_ops = { |
323 | .valid = acpi_suspend_state_valid, | 323 | .valid = acpi_suspend_state_valid, |
324 | .begin = acpi_suspend_begin, | 324 | .begin = acpi_suspend_begin, |
325 | .prepare_late = acpi_pm_prepare, | 325 | .prepare_late = acpi_pm_prepare, |
@@ -347,7 +347,7 @@ static int acpi_suspend_begin_old(suspend_state_t pm_state) | |||
347 | * The following callbacks are used if the pre-ACPI 2.0 suspend ordering has | 347 | * The following callbacks are used if the pre-ACPI 2.0 suspend ordering has |
348 | * been requested. | 348 | * been requested. |
349 | */ | 349 | */ |
350 | static struct platform_suspend_ops acpi_suspend_ops_old = { | 350 | static const struct platform_suspend_ops acpi_suspend_ops_old = { |
351 | .valid = acpi_suspend_state_valid, | 351 | .valid = acpi_suspend_state_valid, |
352 | .begin = acpi_suspend_begin_old, | 352 | .begin = acpi_suspend_begin_old, |
353 | .prepare_late = acpi_pm_pre_suspend, | 353 | .prepare_late = acpi_pm_pre_suspend, |
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c index cd29c8248386..8b021eb0d48c 100644 --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c | |||
@@ -2257,7 +2257,7 @@ static int pmu_sleep_valid(suspend_state_t state) | |||
2257 | && (pmac_call_feature(PMAC_FTR_SLEEP_STATE, NULL, 0, -1) >= 0); | 2257 | && (pmac_call_feature(PMAC_FTR_SLEEP_STATE, NULL, 0, -1) >= 0); |
2258 | } | 2258 | } |
2259 | 2259 | ||
2260 | static struct platform_suspend_ops pmu_pm_ops = { | 2260 | static const struct platform_suspend_ops pmu_pm_ops = { |
2261 | .enter = powerbook_sleep, | 2261 | .enter = powerbook_sleep, |
2262 | .valid = pmu_sleep_valid, | 2262 | .valid = pmu_sleep_valid, |
2263 | }; | 2263 | }; |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 40ead943fd6a..f45f3ccfdfa9 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -122,7 +122,7 @@ struct platform_suspend_ops { | |||
122 | * suspend_set_ops - set platform dependent suspend operations | 122 | * suspend_set_ops - set platform dependent suspend operations |
123 | * @ops: The new suspend operations to set. | 123 | * @ops: The new suspend operations to set. |
124 | */ | 124 | */ |
125 | extern void suspend_set_ops(struct platform_suspend_ops *ops); | 125 | extern void suspend_set_ops(const struct platform_suspend_ops *ops); |
126 | extern int suspend_valid_only_mem(suspend_state_t state); | 126 | extern int suspend_valid_only_mem(suspend_state_t state); |
127 | 127 | ||
128 | /** | 128 | /** |
@@ -147,7 +147,7 @@ extern int pm_suspend(suspend_state_t state); | |||
147 | #else /* !CONFIG_SUSPEND */ | 147 | #else /* !CONFIG_SUSPEND */ |
148 | #define suspend_valid_only_mem NULL | 148 | #define suspend_valid_only_mem NULL |
149 | 149 | ||
150 | static inline void suspend_set_ops(struct platform_suspend_ops *ops) {} | 150 | static inline void suspend_set_ops(const struct platform_suspend_ops *ops) {} |
151 | static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; } | 151 | static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; } |
152 | #endif /* !CONFIG_SUSPEND */ | 152 | #endif /* !CONFIG_SUSPEND */ |
153 | 153 | ||
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index 7335952ee473..80051bdde6f1 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c | |||
@@ -30,13 +30,13 @@ const char *const pm_states[PM_SUSPEND_MAX] = { | |||
30 | [PM_SUSPEND_MEM] = "mem", | 30 | [PM_SUSPEND_MEM] = "mem", |
31 | }; | 31 | }; |
32 | 32 | ||
33 | static struct platform_suspend_ops *suspend_ops; | 33 | static const struct platform_suspend_ops *suspend_ops; |
34 | 34 | ||
35 | /** | 35 | /** |
36 | * suspend_set_ops - Set the global suspend method table. | 36 | * suspend_set_ops - Set the global suspend method table. |
37 | * @ops: Pointer to ops structure. | 37 | * @ops: Pointer to ops structure. |
38 | */ | 38 | */ |
39 | void suspend_set_ops(struct platform_suspend_ops *ops) | 39 | void suspend_set_ops(const struct platform_suspend_ops *ops) |
40 | { | 40 | { |
41 | mutex_lock(&pm_mutex); | 41 | mutex_lock(&pm_mutex); |
42 | suspend_ops = ops; | 42 | suspend_ops = ops; |