From patchwork Fri Oct 8 05:55:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Rui X-Patchwork-Id: 240671 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o985vF9x009495 for ; Fri, 8 Oct 2010 05:57:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753504Ab0JHF51 (ORCPT ); Fri, 8 Oct 2010 01:57:27 -0400 Received: from mga09.intel.com ([134.134.136.24]:46454 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752932Ab0JHF51 (ORCPT ); Fri, 8 Oct 2010 01:57:27 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 07 Oct 2010 22:57:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.57,301,1283756400"; d="scan'208";a="665330964" Received: from rui.sh.intel.com (HELO [10.239.51.31]) ([10.239.51.31]) by orsmga001.jf.intel.com with ESMTP; 07 Oct 2010 22:57:25 -0700 Subject: [PATCH RESEND 5/6] ACPI processor: make /proc/acpi/processor/*/throttle depends on CONFIG_ACPI_PROCFS From: Zhang Rui To: "Brown, Len" Cc: "linux-acpi@vger.kernel.org" , "Zhang, Rui" Date: Fri, 08 Oct 2010 13:55:15 +0800 Message-ID: <1286517315.2111.3800.camel@rui> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 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 (demeter1.kernel.org [140.211.167.41]); Fri, 08 Oct 2010 05:57:28 +0000 (UTC) Index: linux-2.6/drivers/acpi/processor_driver.c =================================================================== --- linux-2.6.orig/drivers/acpi/processor_driver.c +++ linux-2.6/drivers/acpi/processor_driver.c @@ -40,8 +40,10 @@ #include #include #include +#ifdef CONFIG_ACPI_PROCFS #include #include +#endif #include #include #include @@ -244,6 +246,7 @@ static int acpi_processor_errata(struct return result; } +#ifdef CONFIG_ACPI_PROCFS static struct proc_dir_entry *acpi_processor_dir = NULL; static int __cpuinit acpi_processor_add_fs(struct acpi_device *device) @@ -280,7 +283,16 @@ static int acpi_processor_remove_fs(stru return 0; } - +#else +static inline int acpi_processor_add_fs(struct acpi_device *device) +{ + return 0; +} +static inline int acpi_processor_remove_fs(struct acpi_device *device) +{ + return 0; +} +#endif /* -------------------------------------------------------------------------- Driver Interface -------------------------------------------------------------------------- */ @@ -842,9 +854,11 @@ static int __init acpi_processor_init(vo memset(&errata, 0, sizeof(errata)); +#ifdef CONFIG_ACPI_PROCFS acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir); if (!acpi_processor_dir) return -ENOMEM; +#endif if (!cpuidle_register_driver(&acpi_idle_driver)) { printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n", @@ -871,7 +885,9 @@ static int __init acpi_processor_init(vo out_cpuidle: cpuidle_unregister_driver(&acpi_idle_driver); +#ifdef CONFIG_ACPI_PROCFS remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); +#endif return result; } @@ -891,7 +907,9 @@ static void __exit acpi_processor_exit(v cpuidle_unregister_driver(&acpi_idle_driver); +#ifdef CONFIG_ACPI_PROCFS remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); +#endif return; } Index: linux-2.6/drivers/acpi/processor_throttling.c =================================================================== --- linux-2.6.orig/drivers/acpi/processor_throttling.c +++ linux-2.6/drivers/acpi/processor_throttling.c @@ -32,8 +32,10 @@ #include #include #include +#ifdef CONFIG_ACPI_PROCFS #include #include +#endif #include #include @@ -1214,6 +1216,7 @@ int acpi_processor_get_throttling_info(s return result; } +#ifdef CONFIG_ACPI_PROCFS /* proc interface */ static int acpi_processor_throttling_seq_show(struct seq_file *seq, void *offset) @@ -1322,3 +1325,4 @@ const struct file_operations acpi_proces .llseek = seq_lseek, .release = single_release, }; +#endif