diff --git a/Documentation/driver-model/bus.txt b/Documentation/driver-model/bus.txt index dd62c7b80b3f85aeae6805e9fc32234ecb8e6979..5001b751162609052b48f589fb6611c246aa596a 100644 --- a/Documentation/driver-model/bus.txt +++ b/Documentation/driver-model/bus.txt @@ -18,7 +18,7 @@ struct bus_type { int (*match)(struct device * dev, struct device_driver * drv); int (*hotplug) (struct device *dev, char **envp, int num_envp, char *buffer, int buffer_size); - int (*suspend)(struct device * dev, u32 state); + int (*suspend)(struct device * dev, pm_message_t state); int (*resume)(struct device * dev); }; diff --git a/Documentation/driver-model/driver.txt b/Documentation/driver-model/driver.txt index 12447787d329c36699e8ec6937315c2971dec9f2..6031a68dd3f5c249ea5daf391948d058fda44fef 100644 --- a/Documentation/driver-model/driver.txt +++ b/Documentation/driver-model/driver.txt @@ -16,7 +16,7 @@ struct device_driver { int (*probe) (struct device * dev); int (*remove) (struct device * dev); - int (*suspend) (struct device * dev, u32 state, u32 level); + int (*suspend) (struct device * dev, pm_message_t state, u32 level); int (*resume) (struct device * dev, u32 level); void (*release) (struct device_driver * drv); @@ -195,7 +195,7 @@ device; i.e. anything in the device's driver_data field. If the device is still present, it should quiesce the device and place it into a supported low-power state. - int (*suspend) (struct device * dev, u32 state, u32 level); + int (*suspend) (struct device * dev, pm_message_t state, u32 level); suspend is called to put the device in a low power state. There are several stages to successfully suspending a device, which is denoted in diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c index 35c1751ea0b024070e972b7eec884c7e5d26e51c..e3879f7625c2e80a923bf12ede3dce08ca714d0a 100644 --- a/arch/i386/kernel/apic.c +++ b/arch/i386/kernel/apic.c @@ -548,7 +548,7 @@ static struct { unsigned int apic_thmr; } apic_pm_state; -static int lapic_suspend(struct sys_device *dev, u32 state) +static int lapic_suspend(struct sys_device *dev, pm_message_t state) { unsigned long flags; diff --git a/arch/i386/kernel/i8259.c b/arch/i386/kernel/i8259.c index 560bef1afb3b0c8d2f7932c4d7ef877a13a537e5..2c4813b47e57a5603e7bec605129b8890d68c3de 100644 --- a/arch/i386/kernel/i8259.c +++ b/arch/i386/kernel/i8259.c @@ -262,7 +262,7 @@ static int i8259A_resume(struct sys_device *dev) return 0; } -static int i8259A_suspend(struct sys_device *dev, u32 state) +static int i8259A_suspend(struct sys_device *dev, pm_message_t state) { save_ELCR(irq_trigger); return 0; diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c index 9c1350e811d07369dc0a038e415c48129722a431..5e0d55be54357bbc4a1f232a1535b9276d9d876f 100644 --- a/arch/i386/kernel/io_apic.c +++ b/arch/i386/kernel/io_apic.c @@ -2299,7 +2299,7 @@ struct sysfs_ioapic_data { }; static struct sysfs_ioapic_data * mp_ioapic_data[MAX_IO_APICS]; -static int ioapic_suspend(struct sys_device *dev, u32 state) +static int ioapic_suspend(struct sys_device *dev, pm_message_t state) { struct IO_APIC_route_entry *entry; struct sysfs_ioapic_data *data; diff --git a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c index f5b0c5081bd65cae2d2944baf8d3710cfd9b21a8..2f89d000f9540b0e95b6f09b18858dee85c2f64c 100644 --- a/arch/i386/kernel/nmi.c +++ b/arch/i386/kernel/nmi.c @@ -265,7 +265,7 @@ void enable_timer_nmi_watchdog(void) static int nmi_pm_active; /* nmi_active before suspend */ -static int lapic_nmi_suspend(struct sys_device *dev, u32 state) +static int lapic_nmi_suspend(struct sys_device *dev, pm_message_t state) { nmi_pm_active = nmi_active; disable_lapic_nmi_watchdog(); diff --git a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c index 9b55e30e4490cc6e09ca4786861bab9fd975da7a..4d75b373f90eaf3fd01bf229b39f7ec49a98d719 100644 --- a/arch/i386/kernel/time.c +++ b/arch/i386/kernel/time.c @@ -376,7 +376,7 @@ void notify_arch_cmos_timer(void) static long clock_cmos_diff, sleep_start; -static int timer_suspend(struct sys_device *dev, u32 state) +static int timer_suspend(struct sys_device *dev, pm_message_t state) { /* * Estimate time zone so that set_time can update the clock diff --git a/arch/i386/oprofile/nmi_int.c b/arch/i386/oprofile/nmi_int.c index 3492d961d3f17bded544191a6398de9a89e5982e..255e4702d185e363558c5064751ae7be9f9c20c0 100644 --- a/arch/i386/oprofile/nmi_int.c +++ b/arch/i386/oprofile/nmi_int.c @@ -32,7 +32,7 @@ static int nmi_enabled = 0; #ifdef CONFIG_PM -static int nmi_suspend(struct sys_device *dev, u32 state) +static int nmi_suspend(struct sys_device *dev, pm_message_t state) { if (nmi_enabled == 1) nmi_stop(); diff --git a/drivers/base/sys.c b/drivers/base/sys.c index cff5a6a2c78419153fd279786777fffe2db0cb1a..9102e3756f953cfc8bd0303f1add2948ee07a8bc 100644 --- a/drivers/base/sys.c +++ b/drivers/base/sys.c @@ -20,6 +20,7 @@ #include #include #include +#include extern struct subsystem devices_subsys; @@ -302,7 +303,7 @@ void sysdev_shutdown(void) * all synchronization. */ -int sysdev_suspend(u32 state) +int sysdev_suspend(pm_message_t state) { struct sysdev_class * cls; diff --git a/include/linux/pci.h b/include/linux/pci.h index bea13a99e6fb4b10bec28d4fef3c477d8a7cc7d9..3c89148ae28a6e28d4ec21e680a6e383fb885e3d 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -501,6 +501,7 @@ typedef int __bitwise pci_power_t; #define PCI_D2 ((pci_power_t __force) 2) #define PCI_D3hot ((pci_power_t __force) 3) #define PCI_D3cold ((pci_power_t __force) 4) +#define PCI_POWER_ERROR ((pci_power_t __force) -1) /* * The pci_dev structure is used to describe PCI devices. @@ -669,7 +670,7 @@ struct pci_driver { void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */ int (*suspend) (struct pci_dev *dev, pm_message_t state); /* Device suspended */ int (*resume) (struct pci_dev *dev); /* Device woken up */ - int (*enable_wake) (struct pci_dev *dev, u32 state, int enable); /* Enable wake event */ + int (*enable_wake) (struct pci_dev *dev, pci_power_t state, int enable); /* Enable wake event */ struct device_driver driver; struct pci_dynids dynids; @@ -952,7 +953,7 @@ static inline const struct pci_device_id *pci_match_device(const struct pci_devi static inline int pci_save_state(struct pci_dev *dev) { return 0; } static inline int pci_restore_state(struct pci_dev *dev) { return 0; } static inline int pci_set_power_state(struct pci_dev *dev, pci_power_t state) { return 0; } -static inline pci_power_t pci_choose_state(struct pci_dev *dev, u32 state) { return PCI_D0; } +static inline pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state) { return PCI_D0; } static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable) { return 0; } #define isa_bridge ((struct pci_dev *)NULL) diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h index 635db1df656f3442c07023df76b6c5bc3f180a54..2a4b432e117645cf749782a218afc8c32fdf7262 100644 --- a/include/linux/sysdev.h +++ b/include/linux/sysdev.h @@ -22,6 +22,7 @@ #define _SYSDEV_H_ #include +#include struct sys_device; @@ -31,7 +32,7 @@ struct sysdev_class { /* Default operations for these types of devices */ int (*shutdown)(struct sys_device *); - int (*suspend)(struct sys_device *, u32 state); + int (*suspend)(struct sys_device *, pm_message_t state); int (*resume)(struct sys_device *); struct kset kset; }; @@ -50,7 +51,7 @@ struct sysdev_driver { int (*add)(struct sys_device *); int (*remove)(struct sys_device *); int (*shutdown)(struct sys_device *); - int (*suspend)(struct sys_device *, u32 state); + int (*suspend)(struct sys_device *, pm_message_t state); int (*resume)(struct sys_device *); };