Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] move pm_register/etc. to CONFIG_PM_LEGACY, pm_legacy.h

Since few people need the support anymore, this moves the legacy
pm_xxx functions to CONFIG_PM_LEGACY, and include/linux/pm_legacy.h.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Jeff Garzik and committed by
Linus Torvalds
bca73e4b 95e861db

+102 -69
+1
arch/arm/kernel/apm.c
··· 20 20 #include <linux/apm_bios.h> 21 21 #include <linux/sched.h> 22 22 #include <linux/pm.h> 23 + #include <linux/pm_legacy.h> 23 24 #include <linux/device.h> 24 25 #include <linux/kernel.h> 25 26 #include <linux/list.h>
+1
arch/frv/kernel/pm.c
··· 14 14 #include <linux/config.h> 15 15 #include <linux/init.h> 16 16 #include <linux/pm.h> 17 + #include <linux/pm_legacy.h> 17 18 #include <linux/sched.h> 18 19 #include <linux/interrupt.h> 19 20 #include <linux/sysctl.h>
+1 -1
arch/i386/Kconfig
··· 699 699 700 700 config APM 701 701 tristate "APM (Advanced Power Management) BIOS support" 702 - depends on PM 702 + depends on PM && PM_LEGACY 703 703 ---help--- 704 704 APM is a BIOS specification for saving power using several different 705 705 techniques. This is mostly useful for battery powered laptops with
+1
arch/i386/kernel/apm.c
··· 218 218 #include <linux/time.h> 219 219 #include <linux/sched.h> 220 220 #include <linux/pm.h> 221 + #include <linux/pm_legacy.h> 221 222 #include <linux/device.h> 222 223 #include <linux/kernel.h> 223 224 #include <linux/smp.h>
+1
arch/mips/au1000/common/power.c
··· 32 32 #include <linux/config.h> 33 33 #include <linux/init.h> 34 34 #include <linux/pm.h> 35 + #include <linux/pm_legacy.h> 35 36 #include <linux/slab.h> 36 37 #include <linux/sysctl.h> 37 38 #include <linux/jiffies.h>
+2 -1
drivers/acpi/bus.c
··· 28 28 #include <linux/list.h> 29 29 #include <linux/sched.h> 30 30 #include <linux/pm.h> 31 + #include <linux/pm_legacy.h> 31 32 #include <linux/device.h> 32 33 #include <linux/proc_fs.h> 33 34 #ifdef CONFIG_X86 ··· 755 754 result = acpi_bus_init(); 756 755 757 756 if (!result) { 758 - #ifdef CONFIG_PM 757 + #ifdef CONFIG_PM_LEGACY 759 758 if (!PM_IS_ACTIVE()) 760 759 pm_active = 1; 761 760 else {
+7 -6
drivers/net/3c509.c
··· 84 84 #include <linux/netdevice.h> 85 85 #include <linux/etherdevice.h> 86 86 #include <linux/pm.h> 87 + #include <linux/pm_legacy.h> 87 88 #include <linux/skbuff.h> 88 89 #include <linux/delay.h> /* for udelay() */ 89 90 #include <linux/spinlock.h> ··· 174 173 /* skb send-queue */ 175 174 int head, size; 176 175 struct sk_buff *queue[SKB_QUEUE_SIZE]; 177 - #ifdef CONFIG_PM 176 + #ifdef CONFIG_PM_LEGACY 178 177 struct pm_dev *pmdev; 179 178 #endif 180 179 enum { ··· 201 200 static void el3_down(struct net_device *dev); 202 201 static void el3_up(struct net_device *dev); 203 202 static struct ethtool_ops ethtool_ops; 204 - #ifdef CONFIG_PM 203 + #ifdef CONFIG_PM_LEGACY 205 204 static int el3_suspend(struct pm_dev *pdev); 206 205 static int el3_resume(struct pm_dev *pdev); 207 206 static int el3_pm_callback(struct pm_dev *pdev, pm_request_t rqst, void *data); ··· 362 361 struct el3_private *lp = netdev_priv(dev); 363 362 364 363 (void) lp; /* Keep gcc quiet... */ 365 - #ifdef CONFIG_PM 364 + #ifdef CONFIG_PM_LEGACY 366 365 if (lp->pmdev) 367 366 pm_unregister(lp->pmdev); 368 367 #endif ··· 572 571 if (err) 573 572 goto out1; 574 573 575 - #ifdef CONFIG_PM 574 + #ifdef CONFIG_PM_LEGACY 576 575 /* register power management */ 577 576 lp->pmdev = pm_register(PM_ISA_DEV, card_idx, el3_pm_callback); 578 577 if (lp->pmdev) { ··· 1480 1479 } 1481 1480 1482 1481 /* Power Management support functions */ 1483 - #ifdef CONFIG_PM 1482 + #ifdef CONFIG_PM_LEGACY 1484 1483 1485 1484 static int 1486 1485 el3_suspend(struct pm_dev *pdev) ··· 1549 1548 return 0; 1550 1549 } 1551 1550 1552 - #endif /* CONFIG_PM */ 1551 + #endif /* CONFIG_PM_LEGACY */ 1553 1552 1554 1553 /* Parameters that may be passed into the module. */ 1555 1554 static int debug = -1;
+1
drivers/net/irda/ali-ircc.c
··· 40 40 #include <asm/byteorder.h> 41 41 42 42 #include <linux/pm.h> 43 + #include <linux/pm_legacy.h> 43 44 44 45 #include <net/irda/wrapper.h> 45 46 #include <net/irda/irda.h>
+1
drivers/net/irda/nsc-ircc.c
··· 59 59 #include <asm/byteorder.h> 60 60 61 61 #include <linux/pm.h> 62 + #include <linux/pm_legacy.h> 62 63 63 64 #include <net/irda/wrapper.h> 64 65 #include <net/irda/irda.h>
+4 -3
drivers/serial/68328serial.c
··· 34 34 #include <linux/keyboard.h> 35 35 #include <linux/init.h> 36 36 #include <linux/pm.h> 37 + #include <linux/pm_legacy.h> 37 38 #include <linux/bitops.h> 38 39 #include <linux/delay.h> 39 40 ··· 1344 1343 printk("MC68328 serial driver version 1.00\n"); 1345 1344 } 1346 1345 1347 - #ifdef CONFIG_PM 1346 + #ifdef CONFIG_PM_LEGACY 1348 1347 /* Serial Power management 1349 1348 * The console (currently fixed at line 0) is a special case for power 1350 1349 * management because the kernel is so chatty. The console will be ··· 1394 1393 struct m68k_serial *info = &m68k_soft[0]; 1395 1394 startup(info); 1396 1395 } 1397 - #endif 1396 + #endif /* CONFIG_PM_LEGACY */ 1398 1397 1399 1398 1400 1399 static struct tty_operations rs_ops = { ··· 1487 1486 IRQ_FLG_STD, 1488 1487 "M68328_UART", NULL)) 1489 1488 panic("Unable to attach 68328 serial interrupt\n"); 1490 - #ifdef CONFIG_PM 1489 + #ifdef CONFIG_PM_LEGACY 1491 1490 serial_pm[i] = pm_register(PM_SYS_DEV, PM_SYS_COM, serial_pm_callback); 1492 1491 if (serial_pm[i]) 1493 1492 serial_pm[i]->data = info;
-49
include/linux/pm.h
··· 94 94 struct list_head entry; 95 95 }; 96 96 97 - #ifdef CONFIG_PM 98 - 99 - extern int pm_active; 100 - 101 - #define PM_IS_ACTIVE() (pm_active != 0) 102 - 103 - /* 104 - * Register a device with power management 105 - */ 106 - struct pm_dev __deprecated * 107 - pm_register(pm_dev_t type, unsigned long id, pm_callback callback); 108 - 109 - /* 110 - * Unregister a device with power management 111 - */ 112 - void __deprecated pm_unregister(struct pm_dev *dev); 113 - 114 - /* 115 - * Unregister all devices with matching callback 116 - */ 117 - void __deprecated pm_unregister_all(pm_callback callback); 118 - 119 - /* 120 - * Send a request to all devices 121 - */ 122 - int __deprecated pm_send_all(pm_request_t rqst, void *data); 123 - 124 - #else /* CONFIG_PM */ 125 - 126 - #define PM_IS_ACTIVE() 0 127 - 128 - static inline struct pm_dev *pm_register(pm_dev_t type, 129 - unsigned long id, 130 - pm_callback callback) 131 - { 132 - return NULL; 133 - } 134 - 135 - static inline void pm_unregister(struct pm_dev *dev) {} 136 - 137 - static inline void pm_unregister_all(pm_callback callback) {} 138 - 139 - static inline int pm_send_all(pm_request_t rqst, void *data) 140 - { 141 - return 0; 142 - } 143 - 144 - #endif /* CONFIG_PM */ 145 - 146 97 /* Functions above this comment are list-based old-style power 147 98 * managment. Please avoid using them. */ 148 99
+56
include/linux/pm_legacy.h
··· 1 + #ifndef __LINUX_PM_LEGACY_H__ 2 + #define __LINUX_PM_LEGACY_H__ 3 + 4 + #include <linux/config.h> 5 + 6 + #ifdef CONFIG_PM_LEGACY 7 + 8 + extern int pm_active; 9 + 10 + #define PM_IS_ACTIVE() (pm_active != 0) 11 + 12 + /* 13 + * Register a device with power management 14 + */ 15 + struct pm_dev __deprecated * 16 + pm_register(pm_dev_t type, unsigned long id, pm_callback callback); 17 + 18 + /* 19 + * Unregister a device with power management 20 + */ 21 + void __deprecated pm_unregister(struct pm_dev *dev); 22 + 23 + /* 24 + * Unregister all devices with matching callback 25 + */ 26 + void __deprecated pm_unregister_all(pm_callback callback); 27 + 28 + /* 29 + * Send a request to all devices 30 + */ 31 + int __deprecated pm_send_all(pm_request_t rqst, void *data); 32 + 33 + #else /* CONFIG_PM_LEGACY */ 34 + 35 + #define PM_IS_ACTIVE() 0 36 + 37 + static inline struct pm_dev *pm_register(pm_dev_t type, 38 + unsigned long id, 39 + pm_callback callback) 40 + { 41 + return NULL; 42 + } 43 + 44 + static inline void pm_unregister(struct pm_dev *dev) {} 45 + 46 + static inline void pm_unregister_all(pm_callback callback) {} 47 + 48 + static inline int pm_send_all(pm_request_t rqst, void *data) 49 + { 50 + return 0; 51 + } 52 + 53 + #endif /* CONFIG_PM_LEGACY */ 54 + 55 + #endif /* __LINUX_PM_LEGACY_H__ */ 56 +
+9
kernel/power/Kconfig
··· 19 19 will issue the hlt instruction if nothing is to be done, thereby 20 20 sending the processor to sleep and saving power. 21 21 22 + config PM_LEGACY 23 + bool "Legacy Power Management API" 24 + depends on PM 25 + default y 26 + ---help--- 27 + Support for pm_register() and friends. 28 + 29 + If unsure, say Y. 30 + 22 31 config PM_DEBUG 23 32 bool "Power Management Debug Support" 24 33 depends on PM
+2 -1
kernel/power/Makefile
··· 3 3 EXTRA_CFLAGS += -DDEBUG 4 4 endif 5 5 6 - obj-y := main.o process.o console.o pm.o 6 + obj-y := main.o process.o console.o 7 + obj-$(CONFIG_PM_LEGACY) += pm.o 7 8 obj-$(CONFIG_SOFTWARE_SUSPEND) += swsusp.o disk.o snapshot.o 8 9 9 10 obj-$(CONFIG_SUSPEND_SMP) += smp.o
+1
kernel/power/pm.c
··· 23 23 #include <linux/mm.h> 24 24 #include <linux/slab.h> 25 25 #include <linux/pm.h> 26 + #include <linux/pm_legacy.h> 26 27 #include <linux/interrupt.h> 27 28 28 29 int pm_active;
+1
sound/oss/ad1848.c
··· 47 47 #include <linux/module.h> 48 48 #include <linux/stddef.h> 49 49 #include <linux/pm.h> 50 + #include <linux/pm_legacy.h> 50 51 #include <linux/isapnp.h> 51 52 #include <linux/pnp.h> 52 53 #include <linux/spinlock.h>
+1
sound/oss/cs4281/cs4281m.c
··· 298 298 struct cs4281_pipeline pl[CS4281_NUMBER_OF_PIPELINES]; 299 299 }; 300 300 301 + #include <linux/pm_legacy.h> 301 302 #include "cs4281pm-24.c" 302 303 303 304 #if CSDEBUG
+1
sound/oss/maestro.c
··· 231 231 #include <asm/uaccess.h> 232 232 233 233 #include <linux/pm.h> 234 + #include <linux/pm_legacy.h> 234 235 static int maestro_pm_callback(struct pm_dev *dev, pm_request_t rqst, void *d); 235 236 236 237 #include "maestro.h"
+1
sound/oss/nm256_audio.c
··· 25 25 #include <linux/kernel.h> 26 26 #include <linux/module.h> 27 27 #include <linux/pm.h> 28 + #include <linux/pm_legacy.h> 28 29 #include <linux/delay.h> 29 30 #include <linux/spinlock.h> 30 31 #include "sound_config.h"
+10 -8
sound/oss/opl3sa2.c
··· 70 70 #include <linux/module.h> 71 71 #include <linux/delay.h> 72 72 #include <linux/pm.h> 73 + #include <linux/pm_legacy.h> 73 74 #include "sound_config.h" 74 75 75 76 #include "ad1848.h" ··· 139 138 struct pnp_dev* pdev; 140 139 int activated; /* Whether said devices have been activated */ 141 140 #endif 142 - #ifdef CONFIG_PM 141 + #ifdef CONFIG_PM_LEGACY 143 142 unsigned int in_suspend; 144 143 struct pm_dev *pmdev; 145 144 #endif ··· 342 341 } 343 342 344 343 /* Currently only used for power management */ 345 - #ifdef CONFIG_PM 344 + #ifdef CONFIG_PM_LEGACY 346 345 static void opl3sa2_mixer_restore(opl3sa2_state_t* devc) 347 346 { 348 347 if (devc) { ··· 355 354 } 356 355 } 357 356 } 358 - #endif 357 + #endif /* CONFIG_PM_LEGACY */ 359 358 360 359 static inline void arg_to_vol_mono(unsigned int vol, int* value) 361 360 { ··· 832 831 833 832 /* End of component functions */ 834 833 835 - #ifdef CONFIG_PM 834 + #ifdef CONFIG_PM_LEGACY 835 + 836 836 static DEFINE_SPINLOCK(opl3sa2_lock); 837 837 838 838 /* Power Management support functions */ ··· 908 906 } 909 907 return 0; 910 908 } 911 - #endif /* CONFIG_PM */ 909 + #endif /* CONFIG_PM_LEGACY */ 912 910 913 911 /* 914 912 * Install OPL3-SA2 based card(s). ··· 1021 1019 1022 1020 /* ewww =) */ 1023 1021 opl3sa2_state[card].card = card; 1024 - #ifdef CONFIG_PM 1022 + #ifdef CONFIG_PM_LEGACY 1025 1023 /* register our power management capabilities */ 1026 1024 opl3sa2_state[card].pmdev = pm_register(PM_ISA_DEV, card, opl3sa2_pm_callback); 1027 1025 if (opl3sa2_state[card].pmdev) 1028 1026 opl3sa2_state[card].pmdev->data = &opl3sa2_state[card]; 1029 - #endif /* CONFIG_PM */ 1027 + #endif /* CONFIG_PM_LEGACY */ 1030 1028 1031 1029 /* 1032 1030 * Set the Yamaha 3D enhancement mode (aka Ymersion) if asked to and ··· 1083 1081 int card; 1084 1082 1085 1083 for(card = 0; card < opl3sa2_cards_num; card++) { 1086 - #ifdef CONFIG_PM 1084 + #ifdef CONFIG_PM_LEGACY 1087 1085 if (opl3sa2_state[card].pmdev) 1088 1086 pm_unregister(opl3sa2_state[card].pmdev); 1089 1087 #endif