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

[PATCH] pm_message_t: more fixes in common and i386

I thought I'm done with fixing u32 vs. pm_message_t ... unfortunately
that turned out not to be the case as Russel King pointed out. Here are
fixes for Documentation and common code (mainly system devices).

Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Pavel Machek and committed by
Linus Torvalds
438510f6 74ad74c1

+17 -14
+1 -1
Documentation/driver-model/bus.txt
··· 18 18 int (*match)(struct device * dev, struct device_driver * drv); 19 19 int (*hotplug) (struct device *dev, char **envp, 20 20 int num_envp, char *buffer, int buffer_size); 21 - int (*suspend)(struct device * dev, u32 state); 21 + int (*suspend)(struct device * dev, pm_message_t state); 22 22 int (*resume)(struct device * dev); 23 23 }; 24 24
+2 -2
Documentation/driver-model/driver.txt
··· 16 16 int (*probe) (struct device * dev); 17 17 int (*remove) (struct device * dev); 18 18 19 - int (*suspend) (struct device * dev, u32 state, u32 level); 19 + int (*suspend) (struct device * dev, pm_message_t state, u32 level); 20 20 int (*resume) (struct device * dev, u32 level); 21 21 22 22 void (*release) (struct device_driver * drv); ··· 195 195 If the device is still present, it should quiesce the device and place 196 196 it into a supported low-power state. 197 197 198 - int (*suspend) (struct device * dev, u32 state, u32 level); 198 + int (*suspend) (struct device * dev, pm_message_t state, u32 level); 199 199 200 200 suspend is called to put the device in a low power state. There are 201 201 several stages to successfully suspending a device, which is denoted in
+1 -1
arch/i386/kernel/apic.c
··· 548 548 unsigned int apic_thmr; 549 549 } apic_pm_state; 550 550 551 - static int lapic_suspend(struct sys_device *dev, u32 state) 551 + static int lapic_suspend(struct sys_device *dev, pm_message_t state) 552 552 { 553 553 unsigned long flags; 554 554
+1 -1
arch/i386/kernel/i8259.c
··· 262 262 return 0; 263 263 } 264 264 265 - static int i8259A_suspend(struct sys_device *dev, u32 state) 265 + static int i8259A_suspend(struct sys_device *dev, pm_message_t state) 266 266 { 267 267 save_ELCR(irq_trigger); 268 268 return 0;
+1 -1
arch/i386/kernel/io_apic.c
··· 2299 2299 }; 2300 2300 static struct sysfs_ioapic_data * mp_ioapic_data[MAX_IO_APICS]; 2301 2301 2302 - static int ioapic_suspend(struct sys_device *dev, u32 state) 2302 + static int ioapic_suspend(struct sys_device *dev, pm_message_t state) 2303 2303 { 2304 2304 struct IO_APIC_route_entry *entry; 2305 2305 struct sysfs_ioapic_data *data;
+1 -1
arch/i386/kernel/nmi.c
··· 265 265 266 266 static int nmi_pm_active; /* nmi_active before suspend */ 267 267 268 - static int lapic_nmi_suspend(struct sys_device *dev, u32 state) 268 + static int lapic_nmi_suspend(struct sys_device *dev, pm_message_t state) 269 269 { 270 270 nmi_pm_active = nmi_active; 271 271 disable_lapic_nmi_watchdog();
+1 -1
arch/i386/kernel/time.c
··· 376 376 377 377 static long clock_cmos_diff, sleep_start; 378 378 379 - static int timer_suspend(struct sys_device *dev, u32 state) 379 + static int timer_suspend(struct sys_device *dev, pm_message_t state) 380 380 { 381 381 /* 382 382 * Estimate time zone so that set_time can update the clock
+1 -1
arch/i386/oprofile/nmi_int.c
··· 32 32 33 33 #ifdef CONFIG_PM 34 34 35 - static int nmi_suspend(struct sys_device *dev, u32 state) 35 + static int nmi_suspend(struct sys_device *dev, pm_message_t state) 36 36 { 37 37 if (nmi_enabled == 1) 38 38 nmi_stop();
+2 -1
drivers/base/sys.c
··· 20 20 #include <linux/init.h> 21 21 #include <linux/slab.h> 22 22 #include <linux/string.h> 23 + #include <linux/pm.h> 23 24 24 25 25 26 extern struct subsystem devices_subsys; ··· 303 302 * all synchronization. 304 303 */ 305 304 306 - int sysdev_suspend(u32 state) 305 + int sysdev_suspend(pm_message_t state) 307 306 { 308 307 struct sysdev_class * cls; 309 308
+3 -2
include/linux/pci.h
··· 501 501 #define PCI_D2 ((pci_power_t __force) 2) 502 502 #define PCI_D3hot ((pci_power_t __force) 3) 503 503 #define PCI_D3cold ((pci_power_t __force) 4) 504 + #define PCI_POWER_ERROR ((pci_power_t __force) -1) 504 505 505 506 /* 506 507 * The pci_dev structure is used to describe PCI devices. ··· 670 669 void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */ 671 670 int (*suspend) (struct pci_dev *dev, pm_message_t state); /* Device suspended */ 672 671 int (*resume) (struct pci_dev *dev); /* Device woken up */ 673 - int (*enable_wake) (struct pci_dev *dev, u32 state, int enable); /* Enable wake event */ 672 + int (*enable_wake) (struct pci_dev *dev, pci_power_t state, int enable); /* Enable wake event */ 674 673 675 674 struct device_driver driver; 676 675 struct pci_dynids dynids; ··· 953 952 static inline int pci_save_state(struct pci_dev *dev) { return 0; } 954 953 static inline int pci_restore_state(struct pci_dev *dev) { return 0; } 955 954 static inline int pci_set_power_state(struct pci_dev *dev, pci_power_t state) { return 0; } 956 - static inline pci_power_t pci_choose_state(struct pci_dev *dev, u32 state) { return PCI_D0; } 955 + static inline pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state) { return PCI_D0; } 957 956 static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable) { return 0; } 958 957 959 958 #define isa_bridge ((struct pci_dev *)NULL)
+3 -2
include/linux/sysdev.h
··· 22 22 #define _SYSDEV_H_ 23 23 24 24 #include <linux/kobject.h> 25 + #include <linux/pm.h> 25 26 26 27 27 28 struct sys_device; ··· 32 31 33 32 /* Default operations for these types of devices */ 34 33 int (*shutdown)(struct sys_device *); 35 - int (*suspend)(struct sys_device *, u32 state); 34 + int (*suspend)(struct sys_device *, pm_message_t state); 36 35 int (*resume)(struct sys_device *); 37 36 struct kset kset; 38 37 }; ··· 51 50 int (*add)(struct sys_device *); 52 51 int (*remove)(struct sys_device *); 53 52 int (*shutdown)(struct sys_device *); 54 - int (*suspend)(struct sys_device *, u32 state); 53 + int (*suspend)(struct sys_device *, pm_message_t state); 55 54 int (*resume)(struct sys_device *); 56 55 }; 57 56