patch-2.4.0-test11 linux/arch/i386/kernel/apm.c

Next file: linux/arch/i386/kernel/bluesmoke.c
Previous file: linux/arch/i386/kernel/apic.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test10/linux/arch/i386/kernel/apm.c linux/arch/i386/kernel/apm.c
@@ -1126,6 +1126,7 @@
 		}
 #endif
 	}
+	remove_wait_queue(&apm_waitqueue, &wait);
 }
 
 static int check_apm_user(struct apm_user *as, const char *func)
@@ -1422,9 +1423,6 @@
 
 	kapmd_running = 1;
 
-	exit_files(current);	/* daemonize doesn't do exit_files */
-	current->files = init_task.files;
-	atomic_inc(&current->files->count);
 	daemonize();
 
 	strcpy(current->comm, "kapm-idled");
@@ -1574,8 +1572,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
@@ -1590,7 +1586,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",
@@ -1600,7 +1596,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;
 	}
 
 	/*
@@ -1629,15 +1625,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;
 
@@ -1686,7 +1682,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);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)