[PATCH] ACPI: fix fan module removal when ACPI_PROCFS is disabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When ACPI_PROCFS is disabled, /proc/acpi/fan/ directory is not created.
So, it should not be removed during the module removal either.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@xxxxxxxxxxxxxx>
---
 drivers/acpi/fan.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

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;
 }
-- 
1.6.6.1

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

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux