Rethinking about this: driver_registered is a bit too general variable?

Is this OK, now?

Subject: Exit ACPI processor module gracefully if acpi is disabled

Signed-off-by: Thomas Renninger <[EMAIL PROTECTED]>

 drivers/acpi/processor_core.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletion(-)

Index: linux-2.6.16/drivers/acpi/processor_core.c
===================================================================
--- linux-2.6.16.orig/drivers/acpi/processor_core.c
+++ linux-2.6.16/drivers/acpi/processor_core.c
@@ -906,6 +906,8 @@ void acpi_processor_uninstall_hotplug_no
  * ACPI, but needs symbols from this driver
  */
 
+static int processor_driver_registered = 0;
+
 static int __init acpi_processor_init(void)
 {
        int result = 0;
@@ -926,6 +928,8 @@ static int __init acpi_processor_init(vo
                return_VALUE(0);
        }
 
+       processor_driver_registered = 1;
+
        acpi_processor_install_hotplug_notify();
 
        acpi_thermal_cpufreq_init();
@@ -943,12 +947,13 @@ static void __exit acpi_processor_exit(v
 
        acpi_thermal_cpufreq_exit();
 
+       if (processor_driver_registered){
        acpi_processor_uninstall_hotplug_notify();
 
        acpi_bus_unregister_driver(&acpi_processor_driver);
 
        remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);
-
+       }
        return_VOID;
 }
 


-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to