From: akpm@linux-foundation.org Subject: [patch 3/6] Exit ACPI processor module gracefully if acpi is disabled Date: Tue, 06 Mar 2007 02:29:41 -0800 Message-ID: <200703061029.l26ATf9x019122@shell0.pdx.osdl.net> Return-path: Received: from smtp.osdl.org ([65.172.181.24]:33926 "EHLO smtp.osdl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934007AbXCFKbB (ORCPT ); Tue, 6 Mar 2007 05:31:01 -0500 Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: lenb@kernel.org Cc: linux-acpi@vger.kernel.org, akpm@linux-foundation.org, trenn@suse.de From: Thomas Renninger Signed-off-by: Thomas Renninger Cc: Len Brown Signed-off-by: Andrew Morton --- drivers/acpi/processor_core.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff -puN drivers/acpi/processor_core.c~exit-acpi-processor-module-gracefully-if-acpi-is-disabled drivers/acpi/processor_core.c --- a/drivers/acpi/processor_core.c~exit-acpi-processor-module-gracefully-if-acpi-is-disabled +++ a/drivers/acpi/processor_core.c @@ -994,6 +994,8 @@ void acpi_processor_uninstall_hotplug_no * ACPI, but needs symbols from this driver */ +static int processor_driver_registered; + static int __init acpi_processor_init(void) { int result = 0; @@ -1019,6 +1021,8 @@ static int __init acpi_processor_init(vo return result; } + processor_driver_registered = 1; + acpi_processor_install_hotplug_notify(); acpi_thermal_cpufreq_init(); @@ -1037,12 +1041,13 @@ static void __exit acpi_processor_exit(v acpi_thermal_cpufreq_exit(); - acpi_processor_uninstall_hotplug_notify(); - - acpi_bus_unregister_driver(&acpi_processor_driver); + if (processor_driver_registered) { + acpi_processor_uninstall_hotplug_notify(); - remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); + acpi_bus_unregister_driver(&acpi_processor_driver); + remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); + } return; } _