mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] make SMP power off work when APM is a module
@ 2000-11-14  3:13 Stephen Rothwell
  0 siblings, 0 replies; only message in thread
From: Stephen Rothwell @ 2000-11-14  3:13 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

Hi Linus,

This patch corrects the return codes from apm's init routine
and in particular should allow SMP power off to work when APM
is compiled as a module.

Cheers,
Stephen
-- 
Stephen Rothwell, Open Source Researcher, Linuxcare, Inc.
+61-2-62628990 tel, +61-2-62628991 fax 
sfr@linuxcare.com, http://www.linuxcare.com/ 
Linuxcare. Support for the revolution.

diff -ruN 2.4.0-test11pre4/arch/i386/kernel/apm.c 2.4.0-test11pre4-APM.1/arch/i386/kernel/apm.c
--- 2.4.0-test11pre4/arch/i386/kernel/apm.c	Mon Nov 13 17:46:42 2000
+++ 2.4.0-test11pre4-APM.1/arch/i386/kernel/apm.c	Tue Nov 14 00:30:28 2000
@@ -1571,8 +1571,6 @@
 	&apm_bios_fops
 };
 
-#define APM_INIT_ERROR_RETURN	return -1
-
 /*
  * Just start the APM thread. We do NOT want to do APM BIOS
  * calls from anything but the APM thread, if for no other reason
@@ -1587,7 +1585,7 @@
 {
 	if (apm_bios_info.version == 0) {
 		printk(KERN_INFO "apm: BIOS not found.\n");
-		APM_INIT_ERROR_RETURN;
+		return -ENODEV;
 	}
 	printk(KERN_INFO
 		"apm: BIOS version %d.%d Flags 0x%02x (Driver version %s)\n",
@@ -1597,7 +1595,7 @@
 		driver_version);
 	if ((apm_bios_info.flags & APM_32_BIT_SUPPORT) == 0) {
 		printk(KERN_INFO "apm: no 32 bit BIOS support\n");
-		APM_INIT_ERROR_RETURN;
+		return -ENODEV;
 	}
 
 	/*
@@ -1626,15 +1624,15 @@
 
 	if (apm_disabled) {
 		printk(KERN_NOTICE "apm: disabled on user request.\n");
-		APM_INIT_ERROR_RETURN;
+		return -ENODEV;
 	}
 	if ((smp_num_cpus > 1) && !power_off) {
 		printk(KERN_NOTICE "apm: disabled - APM is not SMP safe.\n");
-		APM_INIT_ERROR_RETURN;
+		return -ENODEV;
 	}
 	if (PM_IS_ACTIVE()) {
 		printk(KERN_NOTICE "apm: overridden by ACPI.\n");
-		APM_INIT_ERROR_RETURN;
+		return -ENODEV;
 	}
 	pm_active = 1;
 
@@ -1683,7 +1681,7 @@
 	if (smp_num_cpus > 1) {
 		printk(KERN_NOTICE
 		   "apm: disabled - APM is not SMP safe (power off active).\n");
-		APM_INIT_ERROR_RETURN;
+		return 0;
 	}
 
 	misc_register(&apm_device);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-11-14  3:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-14  3:13 [PATCH] make SMP power off work when APM is a module Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®