diff mbox

ACPI: fix fan module removal when ACPI_PROCFS is disabled

Message ID 1272385158-4080-1-git-send-email-cascardo@holoscopio.com (mailing list archive)
State New, archived
Headers show

Commit Message

Thadeu Lima de Souza Cascardo April 27, 2010, 4:19 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index acf2ab2..d92c035 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -355,12 +355,13 @@  static int __init acpi_fan_init(void)
 #endif
 
 	result = acpi_bus_register_driver(&acpi_fan_driver);
-	if (result < 0) {
+
+#ifdef CONFIG_ACPI_PROCFS
+	if (result < 0)
 		remove_proc_entry(ACPI_FAN_CLASS, acpi_root_dir);
-		return -ENODEV;
-	}
+#endif
 
-	return 0;
+	return result;
 }
 
 static void __exit acpi_fan_exit(void)
@@ -368,7 +369,9 @@  static void __exit acpi_fan_exit(void)
 
 	acpi_bus_unregister_driver(&acpi_fan_driver);
 
+#ifdef CONFIG_ACPI_PROCFS
 	remove_proc_entry(ACPI_FAN_CLASS, acpi_root_dir);
+#endif
 
 	return;
 }