[POWERPC] Fix undefined reference to device_power_up/resume

Current Linus tree fails to link on pmac32:

drivers/built-in.o: In function `pmac_wakeup_devices':
via-pmu.c:(.text+0x5bab4): undefined reference to `device_power_up'
via-pmu.c:(.text+0x5bb08): undefined reference to `device_resume'
drivers/built-in.o: In function `pmac_suspend_devices':
via-pmu.c:(.text+0x5c260): undefined reference to `device_power_down'
via-pmu.c:(.text+0x5c27c): undefined reference to `device_resume'
make[1]: *** [.tmp_vmlinux1] Error 1

changing CONFIG_PM > CONFIG_PM_SLEEP leads to:

drivers/built-in.o: In function `pmu_led_set':
via-pmu-led.c:(.text+0x5cdca): undefined reference to `pmu_sys_suspended'
via-pmu-led.c:(.text+0x5cdce): undefined reference to `pmu_sys_suspended'
drivers/built-in.o: In function `pmu_req_done':
via-pmu-led.c:(.text+0x5ce3e): undefined reference to `pmu_sys_suspended'
via-pmu-led.c:(.text+0x5ce42): undefined reference to `pmu_sys_suspended'
drivers/built-in.o: In function `adb_init':
(.init.text+0x4c5c): undefined reference to `pmu_register_sleep_notifier'
make[1]: *** [.tmp_vmlinux1] Error 1

So change even more places from PM to PM_SLEEP to allow linking.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>

authored by Olaf Hering and committed by Paul Mackerras e120e8d0 b22ddc70

+20 -20
+2 -2
drivers/macintosh/adb.c
··· 89 89 static int autopoll_devs; 90 90 int __adb_probe_sync; 91 91 92 - #ifdef CONFIG_PM 92 + #ifdef CONFIG_PM_SLEEP 93 93 static void adb_notify_sleep(struct pmu_sleep_notifier *self, int when); 94 94 static struct pmu_sleep_notifier adb_sleep_notifier = { 95 95 adb_notify_sleep, ··· 313 313 printk(KERN_WARNING "Warning: no ADB interface detected\n"); 314 314 adb_controller = NULL; 315 315 } else { 316 - #ifdef CONFIG_PM 316 + #ifdef CONFIG_PM_SLEEP 317 317 pmu_register_sleep_notifier(&adb_sleep_notifier); 318 318 #endif /* CONFIG_PM */ 319 319 #ifdef CONFIG_PPC
+17 -17
drivers/macintosh/via-pmu.c
··· 152 152 static u8 pmu_intr_mask; 153 153 static int pmu_version; 154 154 static int drop_interrupts; 155 - #if defined(CONFIG_PM) && defined(CONFIG_PPC32) 155 + #if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32) 156 156 static int option_lid_wakeup = 1; 157 - #endif /* CONFIG_PM && CONFIG_PPC32 */ 158 - #if (defined(CONFIG_PM)&&defined(CONFIG_PPC32))||defined(CONFIG_PMAC_BACKLIGHT_LEGACY) 157 + #endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */ 158 + #if (defined(CONFIG_PM_SLEEP)&&defined(CONFIG_PPC32))||defined(CONFIG_PMAC_BACKLIGHT_LEGACY) 159 159 static int sleep_in_progress; 160 160 #endif 161 161 static unsigned long async_req_locks; ··· 875 875 { 876 876 char *p = page; 877 877 878 - #if defined(CONFIG_PM) && defined(CONFIG_PPC32) 878 + #if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32) 879 879 if (pmu_kind == PMU_KEYLARGO_BASED && 880 880 pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) >= 0) 881 881 p += sprintf(p, "lid_wakeup=%d\n", option_lid_wakeup); ··· 916 916 *(val++) = 0; 917 917 while(*val == ' ') 918 918 val++; 919 - #if defined(CONFIG_PM) && defined(CONFIG_PPC32) 919 + #if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32) 920 920 if (pmu_kind == PMU_KEYLARGO_BASED && 921 921 pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) >= 0) 922 922 if (!strcmp(label, "lid_wakeup")) ··· 1738 1738 return via != 0; 1739 1739 } 1740 1740 1741 - #ifdef CONFIG_PM 1741 + #ifdef CONFIG_PM_SLEEP 1742 1742 1743 1743 static LIST_HEAD(sleep_notifiers); 1744 1744 ··· 1769 1769 return 0; 1770 1770 } 1771 1771 EXPORT_SYMBOL(pmu_unregister_sleep_notifier); 1772 - #endif /* CONFIG_PM */ 1772 + #endif /* CONFIG_PM_SLEEP */ 1773 1773 1774 - #if defined(CONFIG_PM) && defined(CONFIG_PPC32) 1774 + #if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32) 1775 1775 1776 1776 /* Sleep is broadcast last-to-first */ 1777 1777 static void broadcast_sleep(int when) ··· 2390 2390 return 0; 2391 2391 } 2392 2392 2393 - #endif /* CONFIG_PM && CONFIG_PPC32 */ 2393 + #endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */ 2394 2394 2395 2395 /* 2396 2396 * Support for /dev/pmu device ··· 2573 2573 int error = -EINVAL; 2574 2574 2575 2575 switch (cmd) { 2576 - #if defined(CONFIG_PM) && defined(CONFIG_PPC32) 2576 + #if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32) 2577 2577 case PMU_IOC_SLEEP: 2578 2578 if (!capable(CAP_SYS_ADMIN)) 2579 2579 return -EACCES; ··· 2601 2601 return put_user(0, argp); 2602 2602 else 2603 2603 return put_user(1, argp); 2604 - #endif /* CONFIG_PM && CONFIG_PPC32 */ 2604 + #endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */ 2605 2605 2606 2606 #ifdef CONFIG_PMAC_BACKLIGHT_LEGACY 2607 2607 /* Compatibility ioctl's for backlight */ ··· 2757 2757 * to do suspend-to-disk. 2758 2758 */ 2759 2759 2760 - #if defined(CONFIG_PM) && defined(CONFIG_PPC32) 2760 + #if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32) 2761 2761 2762 2762 int pmu_sys_suspended; 2763 2763 ··· 2792 2792 return 0; 2793 2793 } 2794 2794 2795 - #endif /* CONFIG_PM && CONFIG_PPC32 */ 2795 + #endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */ 2796 2796 2797 2797 static struct sysdev_class pmu_sysclass = { 2798 2798 set_kset_name("pmu"), ··· 2803 2803 }; 2804 2804 2805 2805 static struct sysdev_driver driver_pmu = { 2806 - #if defined(CONFIG_PM) && defined(CONFIG_PPC32) 2806 + #if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32) 2807 2807 .suspend = &pmu_sys_suspend, 2808 2808 .resume = &pmu_sys_resume, 2809 - #endif /* CONFIG_PM && CONFIG_PPC32 */ 2809 + #endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */ 2810 2810 }; 2811 2811 2812 2812 static int __init init_pmu_sysfs(void) ··· 2841 2841 EXPORT_SYMBOL(pmu_suspend); 2842 2842 EXPORT_SYMBOL(pmu_resume); 2843 2843 EXPORT_SYMBOL(pmu_unlock); 2844 - #if defined(CONFIG_PM) && defined(CONFIG_PPC32) 2844 + #if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32) 2845 2845 EXPORT_SYMBOL(pmu_enable_irled); 2846 2846 EXPORT_SYMBOL(pmu_battery_count); 2847 2847 EXPORT_SYMBOL(pmu_batteries); 2848 2848 EXPORT_SYMBOL(pmu_power_flags); 2849 - #endif /* CONFIG_PM && CONFIG_PPC32 */ 2849 + #endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */ 2850 2850
+1 -1
include/linux/pmu.h
··· 226 226 extern void pmu_backlight_init(void); 227 227 228 228 /* some code needs to know if the PMU was suspended for hibernation */ 229 - #if defined(CONFIG_PM) && defined(CONFIG_PPC32) 229 + #if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32) 230 230 extern int pmu_sys_suspended; 231 231 #else 232 232 /* if power management is not configured it can't be suspended */