mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ACPI: fix fan module removal when ACPI_PROCFS is disabled
@ 2010-04-27 16:19 Thadeu Lima de Souza Cascardo
  2010-04-27 17:12 ` Len Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2010-04-27 16:19 UTC (permalink / raw)
  To: linux-acpi; +Cc: lenb, rui.zhang, linux-kernel, Thadeu Lima de Souza Cascardo

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ACPI: fix fan module removal when ACPI_PROCFS is disabled
  2010-04-27 16:19 [PATCH] ACPI: fix fan module removal when ACPI_PROCFS is disabled Thadeu Lima de Souza Cascardo
@ 2010-04-27 17:12 ` Len Brown
  2010-04-27 17:18   ` Thadeu Lima de Souza Cascardo
  0 siblings, 1 reply; 3+ messages in thread
From: Len Brown @ 2010-04-27 17:12 UTC (permalink / raw)
  To: Thadeu Lima de Souza Cascardo; +Cc: linux-acpi, rui.zhang, linux-kernel

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

Yes, this patch would make the #ifdefs consistent.
But it looks like remove_proc_entry() just silently does nothing
if the directory is not there, yes?

What I'd really like to see is a patch removing fan.c's proc code 
completely.  It was scheduld for removal in July 2008.

thanks,
Len Brown, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ACPI: fix fan module removal when ACPI_PROCFS is disabled
  2010-04-27 17:12 ` Len Brown
@ 2010-04-27 17:18   ` Thadeu Lima de Souza Cascardo
  0 siblings, 0 replies; 3+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2010-04-27 17:18 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-acpi, rui.zhang, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 779 bytes --]

On Tue, Apr 27, 2010 at 01:12:49PM -0400, Len Brown wrote:
> > When ACPI_PROCFS is disabled, /proc/acpi/fan/ directory is not created.
> > So, it should not be removed during the module removal either.
> 
> Yes, this patch would make the #ifdefs consistent.
> But it looks like remove_proc_entry() just silently does nothing
> if the directory is not there, yes?
> 

No, I get a WARNING right now. That's why I hit the problem, I've just
randomly removed fan.

> What I'd really like to see is a patch removing fan.c's proc code 
> completely.  It was scheduld for removal in July 2008.
> 

Well, no config for "old fan /proc files"? Simply drop it? If that's OK,
I'll gladly submit another patch.

> thanks,
> Len Brown, Intel Open Source Technology Center

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-04-27 17:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-27 16:19 [PATCH] ACPI: fix fan module removal when ACPI_PROCFS is disabled Thadeu Lima de Souza Cascardo
2010-04-27 17:12 ` Len Brown
2010-04-27 17:18   ` Thadeu Lima de Souza Cascardo

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®