aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLionel Debroux <lionel_debroux@yahoo.fr>2010-11-16 08:14:02 -0500
committerJiri Kosina <jkosina@suse.cz>2010-11-16 08:14:02 -0500
commit2f55ac072f5344519348c0c94b3d2f4cca46847b (patch)
treef3d544ab2812503b12a205b2515111a796638ffb /arch
parentacc2472ed33fc5e72482cc3b3b846077d97c2f8b (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>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-at91/pm.c2
-rw-r--r--arch/arm/mach-davinci/pm.c2
-rw-r--r--arch/arm/mach-imx/pm-imx27.c2
-rw-r--r--arch/arm/mach-lpc32xx/pm.c2
-rw-r--r--arch/arm/mach-omap1/pm.c2
-rw-r--r--arch/arm/mach-omap2/pm24xx.c2
-rw-r--r--arch/arm/mach-omap2/pm34xx.c2
-rw-r--r--arch/arm/mach-omap2/pm44xx.c2
-rw-r--r--arch/arm/mach-pnx4008/pm.c2
-rw-r--r--arch/arm/mach-pxa/pm.c2
-rw-r--r--arch/arm/mach-pxa/sharpsl_pm.c2
-rw-r--r--arch/arm/mach-sa1100/pm.c2
-rw-r--r--arch/arm/plat-samsung/pm.c2
-rw-r--r--arch/avr32/mach-at32ap/pm.c2
-rw-r--r--arch/blackfin/mach-common/pm.c2
-rw-r--r--arch/mips/alchemy/devboards/pm.c2
-rw-r--r--arch/mips/jz4740/pm.c2
-rw-r--r--arch/mips/loongson/common/pm.c2
-rw-r--r--arch/powerpc/platforms/52xx/lite5200_pm.c2
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_pm.c2
-rw-r--r--arch/powerpc/platforms/83xx/suspend.c2
-rw-r--r--arch/powerpc/platforms/pseries/suspend.c2
-rw-r--r--arch/powerpc/sysdev/fsl_pmc.c2
-rw-r--r--arch/sh/boards/mach-hp6xx/pm.c2
-rw-r--r--arch/sh/kernel/cpu/shmobile/pm.c2
25 files changed, 25 insertions, 25 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
304static struct platform_suspend_ops at91_pm_ops ={ 304static 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
113static struct platform_suspend_ops davinci_pm_ops = { 113static 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
35static struct platform_suspend_ops mx27_suspend_ops = { 35static 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
126static struct platform_suspend_ops lpc32xx_pm_ops = { 126static 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
650static struct platform_suspend_ops omap_pm_ops ={ 650static 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
329static struct platform_suspend_ops omap_pm_ops = { 329static 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
597static struct platform_suspend_ops omap_pm_ops = { 597static 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
78static struct platform_suspend_ops omap_pm_ops = { 78static 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
122static struct platform_suspend_ops pnx4008_pm_ops = { 122static 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
99static struct platform_suspend_ops pxa_pm_ops = { 99static 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
871static struct platform_suspend_ops sharpsl_pm_ops = { 871static 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
123static struct platform_suspend_ops sa11x0_pm_ops = { 123static 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
358static struct platform_suspend_ops s3c_pm_ops = { 358static 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
179static struct platform_suspend_ops avr32_pm_ops = { 179static 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
236struct platform_suspend_ops bfin_pm_ops = { 236static 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
113static struct platform_suspend_ops db1x_pm_ops = { 113static 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
45static struct platform_suspend_ops jz4740_pm_ops = { 45static 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
150static struct platform_suspend_ops loongson_pm_ops = { 150static 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
235static struct platform_suspend_ops lite5200_pm_ops = { 235static 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
189static struct platform_suspend_ops mpc52xx_pm_ops = { 189static 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
314static struct platform_suspend_ops mpc83xx_suspend_ops = { 314static 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
156static struct platform_suspend_ops pseries_suspend_ops = { 156static 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
56static struct platform_suspend_ops pmc_suspend_ops = { 56static 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
146static struct platform_suspend_ops hp6x0_pm_ops = { 146static 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
144static struct platform_suspend_ops sh_pm_ops = { 144static 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};