linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Renninger <trenn@suse.de>
To: lenb@kernel.org
Cc: Thomas Renninger <trenn@suse.de>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	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	[thread overview]
Message-ID: <1301571400-9861-2-git-send-email-trenn@suse.de> (raw)
In-Reply-To: <1301571400-9861-1-git-send-email-trenn@suse.de>

- Move param aml_debug_output to other params into sysfs.c
- Split acpi_debugfs_init to prepare custom_method to be
  an own .config option and driver.

Signed-off-by: Thomas Renninger <trenn@suse.de>
CC: Rafael J. Wysocki <rjw@sisk.pl>
CC: lenb@kernel.org
CC: rui.zhang@intel.com
CC: linux-acpi@vger.kernel.org
---
 drivers/acpi/debugfs.c  |   32 +++++++++++++-------------------
 drivers/acpi/internal.h |    3 ++-
 drivers/acpi/sysfs.c    |    8 ++++++++
 3 files changed, 23 insertions(+), 20 deletions(-)

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)
 {
-- 
1.7.3.4


  reply	other threads:[~2011-03-31 11:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-31 11:36 [PATCH 1/3] acpi ec: Cleanup unused stuff Thomas Renninger
2011-03-31 11:36 ` Thomas Renninger [this message]
2011-03-31 21:39   ` [PATCH 2/3] acpi: Cleanup custom_method debug stuff Rafael J. Wysocki
2011-04-01  6:31     ` Zhang Rui
2011-04-01  6:38   ` Len Brown
2011-05-25  9:43     ` Thomas Renninger
2011-03-31 11:36 ` [PATCH 3/3] acpi: Split out custom_method functionality into an own driver Thomas Renninger
2011-03-31 21:41   ` Rafael J. Wysocki
2011-04-01  7:47     ` Thomas Renninger
2011-04-01  7:50     ` [PATCH 3/3] ACPI: " Thomas Renninger
2011-04-01 23:50       ` Rafael J. Wysocki
2011-04-01  6:30 ` [PATCH 1/3] acpi ec: Cleanup unused stuff Len Brown
     [not found] <1301401990-35469-1-git-send-email-trenn@suse.de>
2011-03-29 12:33 ` [PATCH 2/3] acpi: Cleanup custom_method debug stuff Thomas Renninger
2011-03-29 19:27   ` Rafael J. Wysocki
2011-03-30  1:37   ` Zhang Rui
2011-03-30  9:06     ` Thomas Renninger
2011-03-31  1:14       ` Zhang Rui

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=1301571400-9861-2-git-send-email-trenn@suse.de \
    --to=trenn@suse.de \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --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;
as well as URLs for NNTP newsgroup(s).