diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2007-10-18 06:04:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-18 17:37:18 -0400 |
commit | 26398a70ea35f153feb799fa850c71685667712b (patch) | |
tree | e75959ef010bf3521bce2a33e59565c34b0c109d | |
parent | 95d9ffbe01fb21d524c86bf77871255066bc6e55 (diff) |
PM: Rename struct pm_ops and related things
The name of 'struct pm_ops' suggests that it is related to the power
management in general, but in fact it is only related to suspend. Moreover,
its name should indicate what this structure is used for, so it seems
reasonable to change it to 'struct platform_suspend_ops'. In that case, the
name of the global variable of this type used by the PM core and the names of
related functions should be changed accordingly.
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>
-rw-r--r-- | Documentation/power/interface.txt | 2 | ||||
-rw-r--r-- | arch/arm/common/sharpsl_pm.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-at91/pm.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-omap1/pm.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-omap2/pm.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-pnx4008/pm.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-pxa/pm.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-pxa/pxa25x.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-sa1100/pm.c | 6 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/pm.c | 6 | ||||
-rw-r--r-- | arch/blackfin/mach-common/pm.c | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/52xx/mpc52xx_pm.c | 4 | ||||
-rw-r--r-- | arch/sh/boards/hp6xx/pm.c | 6 | ||||
-rw-r--r-- | drivers/acpi/sleep/main.c | 6 | ||||
-rw-r--r-- | include/linux/suspend.h | 22 | ||||
-rw-r--r-- | kernel/power/main.c | 34 |
16 files changed, 62 insertions, 62 deletions
diff --git a/Documentation/power/interface.txt b/Documentation/power/interface.txt index fd5192a8fa8a..e67211fe0ee2 100644 --- a/Documentation/power/interface.txt +++ b/Documentation/power/interface.txt | |||
@@ -20,7 +20,7 @@ states. | |||
20 | /sys/power/disk controls the operating mode of the suspend-to-disk | 20 | /sys/power/disk controls the operating mode of the suspend-to-disk |
21 | mechanism. Suspend-to-disk can be handled in several ways. We have a | 21 | mechanism. Suspend-to-disk can be handled in several ways. We have a |
22 | few options for putting the system to sleep - using the platform driver | 22 | few options for putting the system to sleep - using the platform driver |
23 | (e.g. ACPI or other pm_ops), powering off the system or rebooting the | 23 | (e.g. ACPI or other suspend_ops), powering off the system or rebooting the |
24 | system (for testing). | 24 | system (for testing). |
25 | 25 | ||
26 | Additionally, /sys/power/disk can be used to turn on one of the two testing | 26 | Additionally, /sys/power/disk can be used to turn on one of the two testing |
diff --git a/arch/arm/common/sharpsl_pm.c b/arch/arm/common/sharpsl_pm.c index 85795a765a46..5bba5255b119 100644 --- a/arch/arm/common/sharpsl_pm.c +++ b/arch/arm/common/sharpsl_pm.c | |||
@@ -766,9 +766,9 @@ static void sharpsl_apm_get_power_status(struct apm_power_info *info) | |||
766 | info->battery_life = sharpsl_pm.battstat.mainbat_percent; | 766 | info->battery_life = sharpsl_pm.battstat.mainbat_percent; |
767 | } | 767 | } |
768 | 768 | ||
769 | static struct pm_ops sharpsl_pm_ops = { | 769 | static struct platform_suspend_ops sharpsl_pm_ops = { |
770 | .enter = corgi_pxa_pm_enter, | 770 | .enter = corgi_pxa_pm_enter, |
771 | .valid = pm_valid_only_mem, | 771 | .valid = suspend_valid_only_mem, |
772 | }; | 772 | }; |
773 | 773 | ||
774 | static int __init sharpsl_pm_probe(struct platform_device *pdev) | 774 | static int __init sharpsl_pm_probe(struct platform_device *pdev) |
@@ -800,7 +800,7 @@ static int __init sharpsl_pm_probe(struct platform_device *pdev) | |||
800 | 800 | ||
801 | apm_get_power_status = sharpsl_apm_get_power_status; | 801 | apm_get_power_status = sharpsl_apm_get_power_status; |
802 | 802 | ||
803 | pm_set_ops(&sharpsl_pm_ops); | 803 | suspend_set_ops(&sharpsl_pm_ops); |
804 | 804 | ||
805 | mod_timer(&sharpsl_pm.ac_timer, jiffies + msecs_to_jiffies(250)); | 805 | mod_timer(&sharpsl_pm.ac_timer, jiffies + msecs_to_jiffies(250)); |
806 | 806 | ||
@@ -809,7 +809,7 @@ static int __init sharpsl_pm_probe(struct platform_device *pdev) | |||
809 | 809 | ||
810 | static int sharpsl_pm_remove(struct platform_device *pdev) | 810 | static int sharpsl_pm_remove(struct platform_device *pdev) |
811 | { | 811 | { |
812 | pm_set_ops(NULL); | 812 | suspend_set_ops(NULL); |
813 | 813 | ||
814 | device_remove_file(&pdev->dev, &dev_attr_battery_percentage); | 814 | device_remove_file(&pdev->dev, &dev_attr_battery_percentage); |
815 | device_remove_file(&pdev->dev, &dev_attr_battery_voltage); | 815 | device_remove_file(&pdev->dev, &dev_attr_battery_voltage); |
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c index c7c81c9f769c..98cb61482917 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c | |||
@@ -198,7 +198,7 @@ error: | |||
198 | } | 198 | } |
199 | 199 | ||
200 | 200 | ||
201 | static struct pm_ops at91_pm_ops ={ | 201 | static struct platform_suspend_ops at91_pm_ops ={ |
202 | .valid = at91_pm_valid_state, | 202 | .valid = at91_pm_valid_state, |
203 | .set_target = at91_pm_set_target, | 203 | .set_target = at91_pm_set_target, |
204 | .enter = at91_pm_enter, | 204 | .enter = at91_pm_enter, |
@@ -219,7 +219,7 @@ static int __init at91_pm_init(void) | |||
219 | /* Disable SDRAM low-power mode. Cannot be used with self-refresh. */ | 219 | /* Disable SDRAM low-power mode. Cannot be used with self-refresh. */ |
220 | at91_sys_write(AT91_SDRAMC_LPR, 0); | 220 | at91_sys_write(AT91_SDRAMC_LPR, 0); |
221 | 221 | ||
222 | pm_set_ops(&at91_pm_ops); | 222 | suspend_set_ops(&at91_pm_ops); |
223 | 223 | ||
224 | return 0; | 224 | return 0; |
225 | } | 225 | } |
diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c index 1a27611096a9..8db38dd247a4 100644 --- a/arch/arm/mach-omap1/pm.c +++ b/arch/arm/mach-omap1/pm.c | |||
@@ -673,11 +673,11 @@ static struct irqaction omap_wakeup_irq = { | |||
673 | 673 | ||
674 | 674 | ||
675 | 675 | ||
676 | static struct pm_ops omap_pm_ops ={ | 676 | static struct platform_suspend_ops omap_pm_ops ={ |
677 | .prepare = omap_pm_prepare, | 677 | .prepare = omap_pm_prepare, |
678 | .enter = omap_pm_enter, | 678 | .enter = omap_pm_enter, |
679 | .finish = omap_pm_finish, | 679 | .finish = omap_pm_finish, |
680 | .valid = pm_valid_only_mem, | 680 | .valid = suspend_valid_only_mem, |
681 | }; | 681 | }; |
682 | 682 | ||
683 | static int __init omap_pm_init(void) | 683 | static int __init omap_pm_init(void) |
@@ -734,7 +734,7 @@ static int __init omap_pm_init(void) | |||
734 | else if (cpu_is_omap16xx()) | 734 | else if (cpu_is_omap16xx()) |
735 | omap_writel(OMAP1610_IDLECT3_VAL, OMAP1610_IDLECT3); | 735 | omap_writel(OMAP1610_IDLECT3_VAL, OMAP1610_IDLECT3); |
736 | 736 | ||
737 | pm_set_ops(&omap_pm_ops); | 737 | suspend_set_ops(&omap_pm_ops); |
738 | 738 | ||
739 | #if defined(DEBUG) && defined(CONFIG_PROC_FS) | 739 | #if defined(DEBUG) && defined(CONFIG_PROC_FS) |
740 | omap_pm_init_proc(); | 740 | omap_pm_init_proc(); |
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index f9fd3e3d0a59..9aaa7a2633e8 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c | |||
@@ -362,11 +362,11 @@ static int omap2_pm_finish(suspend_state_t state) | |||
362 | return 0; | 362 | return 0; |
363 | } | 363 | } |
364 | 364 | ||
365 | static struct pm_ops omap_pm_ops = { | 365 | static struct platform_suspend_ops omap_pm_ops = { |
366 | .prepare = omap2_pm_prepare, | 366 | .prepare = omap2_pm_prepare, |
367 | .enter = omap2_pm_enter, | 367 | .enter = omap2_pm_enter, |
368 | .finish = omap2_pm_finish, | 368 | .finish = omap2_pm_finish, |
369 | .valid = pm_valid_only_mem, | 369 | .valid = suspend_valid_only_mem, |
370 | }; | 370 | }; |
371 | 371 | ||
372 | int __init omap2_pm_init(void) | 372 | int __init omap2_pm_init(void) |
@@ -390,7 +390,7 @@ int __init omap2_pm_init(void) | |||
390 | omap2_sram_suspend = omap_sram_push(omap24xx_cpu_suspend, | 390 | omap2_sram_suspend = omap_sram_push(omap24xx_cpu_suspend, |
391 | omap24xx_cpu_suspend_sz); | 391 | omap24xx_cpu_suspend_sz); |
392 | 392 | ||
393 | pm_set_ops(&omap_pm_ops); | 393 | suspend_set_ops(&omap_pm_ops); |
394 | pm_idle = omap2_pm_idle; | 394 | pm_idle = omap2_pm_idle; |
395 | 395 | ||
396 | pmdomain_init(); | 396 | pmdomain_init(); |
diff --git a/arch/arm/mach-pnx4008/pm.c b/arch/arm/mach-pnx4008/pm.c index 23307861f6d5..40116d254349 100644 --- a/arch/arm/mach-pnx4008/pm.c +++ b/arch/arm/mach-pnx4008/pm.c | |||
@@ -117,7 +117,7 @@ static int pnx4008_pm_valid(suspend_state_t state) | |||
117 | (state == PM_SUSPEND_MEM); | 117 | (state == PM_SUSPEND_MEM); |
118 | } | 118 | } |
119 | 119 | ||
120 | static struct pm_ops pnx4008_pm_ops = { | 120 | static struct platform_suspend_ops pnx4008_pm_ops = { |
121 | .enter = pnx4008_pm_enter, | 121 | .enter = pnx4008_pm_enter, |
122 | .valid = pnx4008_pm_valid, | 122 | .valid = pnx4008_pm_valid, |
123 | }; | 123 | }; |
@@ -146,7 +146,7 @@ static int __init pnx4008_pm_init(void) | |||
146 | return -ENOMEM; | 146 | return -ENOMEM; |
147 | } | 147 | } |
148 | 148 | ||
149 | pm_set_ops(&pnx4008_pm_ops); | 149 | suspend_set_ops(&pnx4008_pm_ops); |
150 | return 0; | 150 | return 0; |
151 | } | 151 | } |
152 | 152 | ||
diff --git a/arch/arm/mach-pxa/pm.c b/arch/arm/mach-pxa/pm.c index b59a81a8e7d3..a941c71c7d06 100644 --- a/arch/arm/mach-pxa/pm.c +++ b/arch/arm/mach-pxa/pm.c | |||
@@ -86,7 +86,7 @@ static int pxa_pm_valid(suspend_state_t state) | |||
86 | return -EINVAL; | 86 | return -EINVAL; |
87 | } | 87 | } |
88 | 88 | ||
89 | static struct pm_ops pxa_pm_ops = { | 89 | static struct platform_suspend_ops pxa_pm_ops = { |
90 | .valid = pxa_pm_valid, | 90 | .valid = pxa_pm_valid, |
91 | .enter = pxa_pm_enter, | 91 | .enter = pxa_pm_enter, |
92 | }; | 92 | }; |
@@ -104,7 +104,7 @@ static int __init pxa_pm_init(void) | |||
104 | return -ENOMEM; | 104 | return -ENOMEM; |
105 | } | 105 | } |
106 | 106 | ||
107 | pm_set_ops(&pxa_pm_ops); | 107 | suspend_set_ops(&pxa_pm_ops); |
108 | return 0; | 108 | return 0; |
109 | } | 109 | } |
110 | 110 | ||
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c index 08ccd8f6fbc0..dcd81f8d0833 100644 --- a/arch/arm/mach-pxa/pxa25x.c +++ b/arch/arm/mach-pxa/pxa25x.c | |||
@@ -215,7 +215,7 @@ static void pxa25x_cpu_pm_enter(suspend_state_t state) | |||
215 | 215 | ||
216 | static struct pxa_cpu_pm_fns pxa25x_cpu_pm_fns = { | 216 | static struct pxa_cpu_pm_fns pxa25x_cpu_pm_fns = { |
217 | .save_size = SLEEP_SAVE_SIZE, | 217 | .save_size = SLEEP_SAVE_SIZE, |
218 | .valid = pm_valid_only_mem, | 218 | .valid = suspend_valid_only_mem, |
219 | .save = pxa25x_cpu_pm_save, | 219 | .save = pxa25x_cpu_pm_save, |
220 | .restore = pxa25x_cpu_pm_restore, | 220 | .restore = pxa25x_cpu_pm_restore, |
221 | .enter = pxa25x_cpu_pm_enter, | 221 | .enter = pxa25x_cpu_pm_enter, |
diff --git a/arch/arm/mach-sa1100/pm.c b/arch/arm/mach-sa1100/pm.c index 01a37d3c0727..246c573e7252 100644 --- a/arch/arm/mach-sa1100/pm.c +++ b/arch/arm/mach-sa1100/pm.c | |||
@@ -122,14 +122,14 @@ unsigned long sleep_phys_sp(void *sp) | |||
122 | return virt_to_phys(sp); | 122 | return virt_to_phys(sp); |
123 | } | 123 | } |
124 | 124 | ||
125 | static struct pm_ops sa11x0_pm_ops = { | 125 | static struct platform_suspend_ops sa11x0_pm_ops = { |
126 | .enter = sa11x0_pm_enter, | 126 | .enter = sa11x0_pm_enter, |
127 | .valid = pm_valid_only_mem, | 127 | .valid = suspend_valid_only_mem, |
128 | }; | 128 | }; |
129 | 129 | ||
130 | static int __init sa11x0_pm_init(void) | 130 | static int __init sa11x0_pm_init(void) |
131 | { | 131 | { |
132 | pm_set_ops(&sa11x0_pm_ops); | 132 | suspend_set_ops(&sa11x0_pm_ops); |
133 | return 0; | 133 | return 0; |
134 | } | 134 | } |
135 | 135 | ||
diff --git a/arch/arm/plat-s3c24xx/pm.c b/arch/arm/plat-s3c24xx/pm.c index eab1850616d8..4fdb3117744f 100644 --- a/arch/arm/plat-s3c24xx/pm.c +++ b/arch/arm/plat-s3c24xx/pm.c | |||
@@ -612,9 +612,9 @@ static int s3c2410_pm_enter(suspend_state_t state) | |||
612 | return 0; | 612 | return 0; |
613 | } | 613 | } |
614 | 614 | ||
615 | static struct pm_ops s3c2410_pm_ops = { | 615 | static struct platform_suspend_ops s3c2410_pm_ops = { |
616 | .enter = s3c2410_pm_enter, | 616 | .enter = s3c2410_pm_enter, |
617 | .valid = pm_valid_only_mem, | 617 | .valid = suspend_valid_only_mem, |
618 | }; | 618 | }; |
619 | 619 | ||
620 | /* s3c2410_pm_init | 620 | /* s3c2410_pm_init |
@@ -628,6 +628,6 @@ int __init s3c2410_pm_init(void) | |||
628 | { | 628 | { |
629 | printk("S3C2410 Power Management, (c) 2004 Simtec Electronics\n"); | 629 | printk("S3C2410 Power Management, (c) 2004 Simtec Electronics\n"); |
630 | 630 | ||
631 | pm_set_ops(&s3c2410_pm_ops); | 631 | suspend_set_ops(&s3c2410_pm_ops); |
632 | return 0; | 632 | return 0; |
633 | } | 633 | } |
diff --git a/arch/blackfin/mach-common/pm.c b/arch/blackfin/mach-common/pm.c index bcb5a49e3520..6901891905cc 100644 --- a/arch/blackfin/mach-common/pm.c +++ b/arch/blackfin/mach-common/pm.c | |||
@@ -163,7 +163,7 @@ static int bfin_pm_valid(suspend_state_t state) | |||
163 | return (state == PM_SUSPEND_STANDBY); | 163 | return (state == PM_SUSPEND_STANDBY); |
164 | } | 164 | } |
165 | 165 | ||
166 | struct pm_ops bfin_pm_ops = { | 166 | struct platform_suspend_ops bfin_pm_ops = { |
167 | .prepare = bfin_pm_prepare, | 167 | .prepare = bfin_pm_prepare, |
168 | .enter = bfin_pm_enter, | 168 | .enter = bfin_pm_enter, |
169 | .finish = bfin_pm_finish, | 169 | .finish = bfin_pm_finish, |
@@ -172,7 +172,7 @@ struct pm_ops bfin_pm_ops = { | |||
172 | 172 | ||
173 | static int __init bfin_pm_init(void) | 173 | static int __init bfin_pm_init(void) |
174 | { | 174 | { |
175 | pm_set_ops(&bfin_pm_ops); | 175 | suspend_set_ops(&bfin_pm_ops); |
176 | return 0; | 176 | return 0; |
177 | } | 177 | } |
178 | 178 | ||
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pm.c b/arch/powerpc/platforms/52xx/mpc52xx_pm.c index 0809ec1d725c..44fb064c7a16 100644 --- a/arch/powerpc/platforms/52xx/mpc52xx_pm.c +++ b/arch/powerpc/platforms/52xx/mpc52xx_pm.c | |||
@@ -177,7 +177,7 @@ int mpc52xx_pm_finish(suspend_state_t state) | |||
177 | return 0; | 177 | return 0; |
178 | } | 178 | } |
179 | 179 | ||
180 | static struct pm_ops mpc52xx_pm_ops = { | 180 | static struct platform_suspend_ops mpc52xx_pm_ops = { |
181 | .valid = mpc52xx_pm_valid, | 181 | .valid = mpc52xx_pm_valid, |
182 | .prepare = mpc52xx_pm_prepare, | 182 | .prepare = mpc52xx_pm_prepare, |
183 | .enter = mpc52xx_pm_enter, | 183 | .enter = mpc52xx_pm_enter, |
@@ -186,6 +186,6 @@ static struct pm_ops mpc52xx_pm_ops = { | |||
186 | 186 | ||
187 | int __init mpc52xx_pm_init(void) | 187 | int __init mpc52xx_pm_init(void) |
188 | { | 188 | { |
189 | pm_set_ops(&mpc52xx_pm_ops); | 189 | suspend_set_ops(&mpc52xx_pm_ops); |
190 | return 0; | 190 | return 0; |
191 | } | 191 | } |
diff --git a/arch/sh/boards/hp6xx/pm.c b/arch/sh/boards/hp6xx/pm.c index 8143d1b948e7..d22f6eac9cca 100644 --- a/arch/sh/boards/hp6xx/pm.c +++ b/arch/sh/boards/hp6xx/pm.c | |||
@@ -67,14 +67,14 @@ static int hp6x0_pm_enter(suspend_state_t state) | |||
67 | return 0; | 67 | return 0; |
68 | } | 68 | } |
69 | 69 | ||
70 | static struct pm_ops hp6x0_pm_ops = { | 70 | static struct platform_suspend_ops hp6x0_pm_ops = { |
71 | .enter = hp6x0_pm_enter, | 71 | .enter = hp6x0_pm_enter, |
72 | .valid = pm_valid_only_mem, | 72 | .valid = suspend_valid_only_mem, |
73 | }; | 73 | }; |
74 | 74 | ||
75 | static int __init hp6x0_pm_init(void) | 75 | static int __init hp6x0_pm_init(void) |
76 | { | 76 | { |
77 | pm_set_ops(&hp6x0_pm_ops); | 77 | suspend_set_ops(&hp6x0_pm_ops); |
78 | return 0; | 78 | return 0; |
79 | } | 79 | } |
80 | 80 | ||
diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c index 5055acf2163c..3271850a1f35 100644 --- a/drivers/acpi/sleep/main.c +++ b/drivers/acpi/sleep/main.c | |||
@@ -50,7 +50,7 @@ int acpi_sleep_prepare(u32 acpi_state) | |||
50 | } | 50 | } |
51 | 51 | ||
52 | #ifdef CONFIG_SUSPEND | 52 | #ifdef CONFIG_SUSPEND |
53 | static struct pm_ops acpi_pm_ops; | 53 | static struct platform_suspend_ops acpi_pm_ops; |
54 | 54 | ||
55 | extern void do_suspend_lowlevel(void); | 55 | extern void do_suspend_lowlevel(void); |
56 | 56 | ||
@@ -203,7 +203,7 @@ static int acpi_pm_state_valid(suspend_state_t pm_state) | |||
203 | } | 203 | } |
204 | } | 204 | } |
205 | 205 | ||
206 | static struct pm_ops acpi_pm_ops = { | 206 | static struct platform_suspend_ops acpi_pm_ops = { |
207 | .valid = acpi_pm_state_valid, | 207 | .valid = acpi_pm_state_valid, |
208 | .set_target = acpi_pm_set_target, | 208 | .set_target = acpi_pm_set_target, |
209 | .prepare = acpi_pm_prepare, | 209 | .prepare = acpi_pm_prepare, |
@@ -417,7 +417,7 @@ int __init acpi_sleep_init(void) | |||
417 | } | 417 | } |
418 | } | 418 | } |
419 | 419 | ||
420 | pm_set_ops(&acpi_pm_ops); | 420 | suspend_set_ops(&acpi_pm_ops); |
421 | #endif | 421 | #endif |
422 | 422 | ||
423 | #ifdef CONFIG_HIBERNATION | 423 | #ifdef CONFIG_HIBERNATION |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index c230680d5252..dce47825dbb8 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -27,16 +27,16 @@ typedef int __bitwise suspend_state_t; | |||
27 | #define PM_SUSPEND_MAX ((__force suspend_state_t) 4) | 27 | #define PM_SUSPEND_MAX ((__force suspend_state_t) 4) |
28 | 28 | ||
29 | /** | 29 | /** |
30 | * struct pm_ops - Callbacks for managing platform dependent system sleep | 30 | * struct platform_suspend_ops - Callbacks for managing platform dependent |
31 | * states. | 31 | * system sleep states. |
32 | * | 32 | * |
33 | * @valid: Callback to determine if given system sleep state is supported by | 33 | * @valid: Callback to determine if given system sleep state is supported by |
34 | * the platform. | 34 | * the platform. |
35 | * Valid (ie. supported) states are advertised in /sys/power/state. Note | 35 | * Valid (ie. supported) states are advertised in /sys/power/state. Note |
36 | * that it still may be impossible to enter given system sleep state if the | 36 | * that it still may be impossible to enter given system sleep state if the |
37 | * conditions aren't right. | 37 | * conditions aren't right. |
38 | * There is the %pm_valid_only_mem function available that can be assigned | 38 | * There is the %suspend_valid_only_mem function available that can be |
39 | * to this if the platform only supports mem sleep. | 39 | * assigned to this if the platform only supports mem sleep. |
40 | * | 40 | * |
41 | * @set_target: Tell the platform which system sleep state is going to be | 41 | * @set_target: Tell the platform which system sleep state is going to be |
42 | * entered. | 42 | * entered. |
@@ -73,7 +73,7 @@ typedef int __bitwise suspend_state_t; | |||
73 | * that implement @prepare(). If implemented, it is always called after | 73 | * that implement @prepare(). If implemented, it is always called after |
74 | * @enter() (even if @enter() fails). | 74 | * @enter() (even if @enter() fails). |
75 | */ | 75 | */ |
76 | struct pm_ops { | 76 | struct platform_suspend_ops { |
77 | int (*valid)(suspend_state_t state); | 77 | int (*valid)(suspend_state_t state); |
78 | int (*set_target)(suspend_state_t state); | 78 | int (*set_target)(suspend_state_t state); |
79 | int (*prepare)(suspend_state_t state); | 79 | int (*prepare)(suspend_state_t state); |
@@ -82,14 +82,14 @@ struct pm_ops { | |||
82 | }; | 82 | }; |
83 | 83 | ||
84 | #ifdef CONFIG_SUSPEND | 84 | #ifdef CONFIG_SUSPEND |
85 | extern struct pm_ops *pm_ops; | 85 | extern struct platform_suspend_ops *suspend_ops; |
86 | 86 | ||
87 | /** | 87 | /** |
88 | * pm_set_ops - set platform dependent power management ops | 88 | * suspend_set_ops - set platform dependent suspend operations |
89 | * @pm_ops: The new power management operations to set. | 89 | * @ops: The new suspend operations to set. |
90 | */ | 90 | */ |
91 | extern void pm_set_ops(struct pm_ops *pm_ops); | 91 | extern void suspend_set_ops(struct platform_suspend_ops *ops); |
92 | extern int pm_valid_only_mem(suspend_state_t state); | 92 | extern int suspend_valid_only_mem(suspend_state_t state); |
93 | 93 | ||
94 | /** | 94 | /** |
95 | * arch_suspend_disable_irqs - disable IRQs for suspend | 95 | * arch_suspend_disable_irqs - disable IRQs for suspend |
@@ -113,7 +113,7 @@ extern int pm_suspend(suspend_state_t state); | |||
113 | #else /* !CONFIG_SUSPEND */ | 113 | #else /* !CONFIG_SUSPEND */ |
114 | #define suspend_valid_only_mem NULL | 114 | #define suspend_valid_only_mem NULL |
115 | 115 | ||
116 | static inline void pm_set_ops(struct pm_ops *pm_ops) {} | 116 | static inline void suspend_set_ops(struct platform_suspend_ops *ops) {} |
117 | static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; } | 117 | static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; } |
118 | #endif /* !CONFIG_SUSPEND */ | 118 | #endif /* !CONFIG_SUSPEND */ |
119 | 119 | ||
diff --git a/kernel/power/main.c b/kernel/power/main.c index 2a46b6d62f76..854bf0811d40 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c | |||
@@ -32,28 +32,28 @@ DEFINE_MUTEX(pm_mutex); | |||
32 | /* This is just an arbitrary number */ | 32 | /* This is just an arbitrary number */ |
33 | #define FREE_PAGE_NUMBER (100) | 33 | #define FREE_PAGE_NUMBER (100) |
34 | 34 | ||
35 | struct pm_ops *pm_ops; | 35 | struct platform_suspend_ops *suspend_ops; |
36 | 36 | ||
37 | /** | 37 | /** |
38 | * pm_set_ops - Set the global power method table. | 38 | * suspend_set_ops - Set the global suspend method table. |
39 | * @ops: Pointer to ops structure. | 39 | * @ops: Pointer to ops structure. |
40 | */ | 40 | */ |
41 | 41 | ||
42 | void pm_set_ops(struct pm_ops * ops) | 42 | void suspend_set_ops(struct platform_suspend_ops *ops) |
43 | { | 43 | { |
44 | mutex_lock(&pm_mutex); | 44 | mutex_lock(&pm_mutex); |
45 | pm_ops = ops; | 45 | suspend_ops = ops; |
46 | mutex_unlock(&pm_mutex); | 46 | mutex_unlock(&pm_mutex); |
47 | } | 47 | } |
48 | 48 | ||
49 | /** | 49 | /** |
50 | * pm_valid_only_mem - generic memory-only valid callback | 50 | * suspend_valid_only_mem - generic memory-only valid callback |
51 | * | 51 | * |
52 | * pm_ops drivers that implement mem suspend only and only need | 52 | * Platform drivers that implement mem suspend only and only need |
53 | * to check for that in their .valid callback can use this instead | 53 | * to check for that in their .valid callback can use this instead |
54 | * of rolling their own .valid callback. | 54 | * of rolling their own .valid callback. |
55 | */ | 55 | */ |
56 | int pm_valid_only_mem(suspend_state_t state) | 56 | int suspend_valid_only_mem(suspend_state_t state) |
57 | { | 57 | { |
58 | return state == PM_SUSPEND_MEM; | 58 | return state == PM_SUSPEND_MEM; |
59 | } | 59 | } |
@@ -61,8 +61,8 @@ int pm_valid_only_mem(suspend_state_t state) | |||
61 | 61 | ||
62 | static inline void pm_finish(suspend_state_t state) | 62 | static inline void pm_finish(suspend_state_t state) |
63 | { | 63 | { |
64 | if (pm_ops->finish) | 64 | if (suspend_ops->finish) |
65 | pm_ops->finish(state); | 65 | suspend_ops->finish(state); |
66 | } | 66 | } |
67 | 67 | ||
68 | /** | 68 | /** |
@@ -76,7 +76,7 @@ static int suspend_prepare(void) | |||
76 | int error; | 76 | int error; |
77 | unsigned int free_pages; | 77 | unsigned int free_pages; |
78 | 78 | ||
79 | if (!pm_ops || !pm_ops->enter) | 79 | if (!suspend_ops || !suspend_ops->enter) |
80 | return -EPERM; | 80 | return -EPERM; |
81 | 81 | ||
82 | error = pm_notifier_call_chain(PM_SUSPEND_PREPARE); | 82 | error = pm_notifier_call_chain(PM_SUSPEND_PREPARE); |
@@ -139,7 +139,7 @@ static int suspend_enter(suspend_state_t state) | |||
139 | printk(KERN_ERR "Some devices failed to power down\n"); | 139 | printk(KERN_ERR "Some devices failed to power down\n"); |
140 | goto Done; | 140 | goto Done; |
141 | } | 141 | } |
142 | error = pm_ops->enter(state); | 142 | error = suspend_ops->enter(state); |
143 | device_power_up(); | 143 | device_power_up(); |
144 | Done: | 144 | Done: |
145 | arch_suspend_enable_irqs(); | 145 | arch_suspend_enable_irqs(); |
@@ -156,11 +156,11 @@ int suspend_devices_and_enter(suspend_state_t state) | |||
156 | { | 156 | { |
157 | int error; | 157 | int error; |
158 | 158 | ||
159 | if (!pm_ops) | 159 | if (!suspend_ops) |
160 | return -ENOSYS; | 160 | return -ENOSYS; |
161 | 161 | ||
162 | if (pm_ops->set_target) { | 162 | if (suspend_ops->set_target) { |
163 | error = pm_ops->set_target(state); | 163 | error = suspend_ops->set_target(state); |
164 | if (error) | 164 | if (error) |
165 | return error; | 165 | return error; |
166 | } | 166 | } |
@@ -170,8 +170,8 @@ int suspend_devices_and_enter(suspend_state_t state) | |||
170 | printk(KERN_ERR "Some devices failed to suspend\n"); | 170 | printk(KERN_ERR "Some devices failed to suspend\n"); |
171 | goto Resume_console; | 171 | goto Resume_console; |
172 | } | 172 | } |
173 | if (pm_ops->prepare) { | 173 | if (suspend_ops->prepare) { |
174 | error = pm_ops->prepare(state); | 174 | error = suspend_ops->prepare(state); |
175 | if (error) | 175 | if (error) |
176 | goto Resume_devices; | 176 | goto Resume_devices; |
177 | } | 177 | } |
@@ -214,7 +214,7 @@ static inline int valid_state(suspend_state_t state) | |||
214 | /* All states need lowlevel support and need to be valid | 214 | /* All states need lowlevel support and need to be valid |
215 | * to the lowlevel implementation, no valid callback | 215 | * to the lowlevel implementation, no valid callback |
216 | * implies that none are valid. */ | 216 | * implies that none are valid. */ |
217 | if (!pm_ops || !pm_ops->valid || !pm_ops->valid(state)) | 217 | if (!suspend_ops || !suspend_ops->valid || !suspend_ops->valid(state)) |
218 | return 0; | 218 | return 0; |
219 | return 1; | 219 | return 1; |
220 | } | 220 | } |