From patchwork Tue Apr 27 16:19:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thadeu Lima de Souza Cascardo X-Patchwork-Id: 95464 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3RGTcaB011725 for ; Tue, 27 Apr 2010 16:29:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756369Ab0D0Q2T (ORCPT ); Tue, 27 Apr 2010 12:28:19 -0400 Received: from liberdade.minaslivre.org ([72.232.254.139]:40383 "EHLO liberdade.minaslivre.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756357Ab0D0Q2P (ORCPT ); Tue, 27 Apr 2010 12:28:15 -0400 Received: from localhost.localdomain (unknown [201.80.211.90]) by liberdade.minaslivre.org (Postfix) with ESMTPSA id 363D9603D; Tue, 27 Apr 2010 13:10:56 -0300 (BRT) From: Thadeu Lima de Souza Cascardo To: linux-acpi@vger.kernel.org Cc: lenb@kernel.org, rui.zhang@intel.com, linux-kernel@vger.kernel.org, Thadeu Lima de Souza Cascardo Subject: [PATCH] ACPI: fix fan module removal when ACPI_PROCFS is disabled Date: Tue, 27 Apr 2010 13:19:18 -0300 Message-Id: <1272385158-4080-1-git-send-email-cascardo@holoscopio.com> X-Mailer: git-send-email 1.6.6.1 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 27 Apr 2010 16:29:47 +0000 (UTC) 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; }