X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fi386%2Fkernel%2Fapm.c;h=a005116491f947b1cc4b1bf22e904cf2e3829765;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=d9a80ba232e05b2b4b56544658f4af8bd5923926;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c index d9a80ba23..a00511649 100644 --- a/arch/i386/kernel/apm.c +++ b/arch/i386/kernel/apm.c @@ -424,7 +424,7 @@ static int broken_psr; static DECLARE_WAIT_QUEUE_HEAD(apm_waitqueue); static DECLARE_WAIT_QUEUE_HEAD(apm_suspend_waitqueue); static struct apm_user * user_list; -static spinlock_t user_list_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(user_list_lock); static struct desc_struct bad_bios_desc = { 0, 0x00409200 }; static char driver_version[] = "1.16ac"; /* no spaces */ @@ -1201,8 +1201,8 @@ static int suspend(int vetoable) printk(KERN_CRIT "apm: suspend was vetoed, but suspending anyway.\n"); } - device_suspend(3); - device_power_down(3); + device_suspend(PMSG_SUSPEND); + device_power_down(PMSG_SUSPEND); /* serialize with the timer interrupt */ write_seqlock_irq(&xtime_lock); @@ -1255,7 +1255,7 @@ static void standby(void) { int err; - device_power_down(3); + device_power_down(PMSG_SUSPEND); /* serialize with the timer interrupt */ write_seqlock_irq(&xtime_lock); /* If needed, notify drivers here */ @@ -2369,7 +2369,7 @@ static void __exit apm_exit(void) * (pm_idle), Wait for all processors to update cached/local * copies of pm_idle before proceeding. */ - synchronize_kernel(); + cpu_idle_wait(); } if (((apm_info.bios.flags & APM_BIOS_DISENGAGED) == 0) && (apm_info.connection_version > 0x0100)) { @@ -2393,27 +2393,27 @@ module_exit(apm_exit); MODULE_AUTHOR("Stephen Rothwell"); MODULE_DESCRIPTION("Advanced Power Management"); MODULE_LICENSE("GPL"); -MODULE_PARM(debug, "i"); +module_param(debug, bool, 0644); MODULE_PARM_DESC(debug, "Enable debug mode"); -MODULE_PARM(power_off, "i"); +module_param(power_off, bool, 0444); MODULE_PARM_DESC(power_off, "Enable power off"); -MODULE_PARM(bounce_interval, "i"); +module_param(bounce_interval, int, 0444); MODULE_PARM_DESC(bounce_interval, "Set the number of ticks to ignore suspend bounces"); -MODULE_PARM(allow_ints, "i"); +module_param(allow_ints, bool, 0444); MODULE_PARM_DESC(allow_ints, "Allow interrupts during BIOS calls"); -MODULE_PARM(broken_psr, "i"); +module_param(broken_psr, bool, 0444); MODULE_PARM_DESC(broken_psr, "BIOS has a broken GetPowerStatus call"); -MODULE_PARM(realmode_power_off, "i"); +module_param(realmode_power_off, bool, 0444); MODULE_PARM_DESC(realmode_power_off, "Switch to real mode before powering off"); -MODULE_PARM(idle_threshold, "i"); +module_param(idle_threshold, int, 0444); MODULE_PARM_DESC(idle_threshold, "System idle percentage above which to make APM BIOS idle calls"); -MODULE_PARM(idle_period, "i"); +module_param(idle_period, int, 0444); MODULE_PARM_DESC(idle_period, "Period (in sec/100) over which to caculate the idle percentage"); -MODULE_PARM(smp, "i"); +module_param(smp, bool, 0444); MODULE_PARM_DESC(smp, "Set this to enable APM use on an SMP platform. Use with caution on older systems"); MODULE_ALIAS_MISCDEV(APM_MINOR_DEV);