From patchwork Thu Mar 31 11:36:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Renninger X-Patchwork-Id: 679001 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 p2VBXkZ1004640 for ; Thu, 31 Mar 2011 11:33:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757317Ab1CaLdp (ORCPT ); Thu, 31 Mar 2011 07:33:45 -0400 Received: from cantor2.suse.de ([195.135.220.15]:58939 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751962Ab1CaLdo (ORCPT ); Thu, 31 Mar 2011 07:33:44 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id 8105B8738D; Thu, 31 Mar 2011 13:33:43 +0200 (CEST) From: Thomas Renninger To: lenb@kernel.org Cc: Thomas Renninger , "Rafael J. Wysocki" , rui.zhang@intel.com, linux-acpi@vger.kernel.org Subject: [PATCH 2/3] acpi: Cleanup custom_method debug stuff Date: Thu, 31 Mar 2011 13:36:39 +0200 Message-Id: <1301571400-9861-2-git-send-email-trenn@suse.de> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1301571400-9861-1-git-send-email-trenn@suse.de> References: <1301571400-9861-1-git-send-email-trenn@suse.de> 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.6 (demeter1.kernel.org [140.211.167.41]); Thu, 31 Mar 2011 11:33:46 +0000 (UTC) diff --git a/drivers/acpi/debugfs.c b/drivers/acpi/debugfs.c index 384f7ab..e7abc6e 100644 --- a/drivers/acpi/debugfs.c +++ b/drivers/acpi/debugfs.c @@ -12,13 +12,8 @@ #define _COMPONENT ACPI_SYSTEM_COMPONENT ACPI_MODULE_NAME("debugfs"); - -/* /sys/modules/acpi/parameters/aml_debug_output */ - -module_param_named(aml_debug_output, acpi_gbl_enable_aml_debug_object, - bool, 0644); -MODULE_PARM_DESC(aml_debug_output, - "To enable/disable the ACPI Debug Object output."); +struct dentry *acpi_debugfs_dir; +static struct dentry *cm_dentry; /* /sys/kernel/debug/acpi/custom_method */ @@ -80,23 +75,22 @@ static const struct file_operations cm_fops = { .llseek = default_llseek, }; -int __init acpi_debugfs_init(void) +static int __init acpi_custom_method_init(void) { - struct dentry *acpi_dir, *cm_dentry; - - acpi_dir = debugfs_create_dir("acpi", NULL); - if (!acpi_dir) - goto err; + if (!acpi_debugfs_dir) + return -ENOENT; cm_dentry = debugfs_create_file("custom_method", S_IWUSR, - acpi_dir, NULL, &cm_fops); + acpi_debugfs_dir, NULL, &cm_fops); if (!cm_dentry) - goto err; + return -ENODEV; return 0; +} + +void __init acpi_debugfs_init(void) +{ + acpi_debugfs_dir = debugfs_create_dir("acpi", NULL); -err: - if (acpi_dir) - debugfs_remove(acpi_dir); - return -EINVAL; + acpi_custom_method_init(); } diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h index b1cc81a..afc1a1c 100644 --- a/drivers/acpi/internal.h +++ b/drivers/acpi/internal.h @@ -30,9 +30,10 @@ int acpi_scan_init(void); int acpi_sysfs_init(void); #ifdef CONFIG_DEBUG_FS +extern struct dentry *acpi_debugfs_dir; int acpi_debugfs_init(void); #else -static inline int acpi_debugfs_init(void) { return 0; } +static inline void acpi_debugfs_init(void) { return; } #endif /* -------------------------------------------------------------------------- diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index 61891e7..77255f2 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c @@ -220,6 +220,14 @@ module_param_call(trace_state, param_set_trace_state, param_get_trace_state, NULL, 0644); #endif /* CONFIG_ACPI_DEBUG */ + +/* /sys/modules/acpi/parameters/aml_debug_output */ + +module_param_named(aml_debug_output, acpi_gbl_enable_aml_debug_object, + bool, 0644); +MODULE_PARM_DESC(aml_debug_output, + "To enable/disable the ACPI Debug Object output."); + /* /sys/module/acpi/parameters/acpica_version */ static int param_get_acpica_version(char *buffer, struct kernel_param *kp) {