mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
To: linux-acpi@vger.kernel.org
Cc: lenb@kernel.org, rui.zhang@intel.com,
	linux-kernel@vger.kernel.org,
	Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Subject: [PATCH] ACPI: fix fan module removal when ACPI_PROCFS is disabled
Date: Tue, 27 Apr 2010 13:19:18 -0300	[thread overview]
Message-ID: <1272385158-4080-1-git-send-email-cascardo@holoscopio.com> (raw)

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@holoscopio.com>
---
 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


             reply	other threads:[~2010-04-27 16:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-27 16:19 Thadeu Lima de Souza Cascardo [this message]
2010-04-27 17:12 ` Len Brown
2010-04-27 17:18   ` Thadeu Lima de Souza Cascardo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1272385158-4080-1-git-send-email-cascardo@holoscopio.com \
    --to=cascardo@holoscopio.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®