aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/debugfs.c
diff options
context:
space:
mode:
authorThomas Renninger <trenn@suse.de>2011-05-26 06:26:23 -0400
committerLen Brown <len.brown@intel.com>2011-05-29 01:50:04 -0400
commitaecad432fd68dafa5b3b497c4816fbfce6fd4066 (patch)
tree168b6b7358df13e2d1bd967c217599c77dd21fd8 /drivers/acpi/debugfs.c
parent61c4f2c81c61f73549928dfd9f3e8f26aa36a8cf (diff)
ACPI: Cleanup custom_method debug stuff
- 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> Acked-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: rui.zhang@intel.com Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/debugfs.c')
-rw-r--r--drivers/acpi/debugfs.c32
1 files changed, 13 insertions, 19 deletions
diff --git a/drivers/acpi/debugfs.c b/drivers/acpi/debugfs.c
index 384f7abcff77..e7abc6e3bba0 100644
--- a/drivers/acpi/debugfs.c
+++ b/drivers/acpi/debugfs.c
@@ -12,13 +12,8 @@
12#define _COMPONENT ACPI_SYSTEM_COMPONENT 12#define _COMPONENT ACPI_SYSTEM_COMPONENT
13ACPI_MODULE_NAME("debugfs"); 13ACPI_MODULE_NAME("debugfs");
14 14
15 15struct dentry *acpi_debugfs_dir;
16/* /sys/modules/acpi/parameters/aml_debug_output */ 16static struct dentry *cm_dentry;
17
18module_param_named(aml_debug_output, acpi_gbl_enable_aml_debug_object,
19 bool, 0644);
20MODULE_PARM_DESC(aml_debug_output,
21 "To enable/disable the ACPI Debug Object output.");
22 17
23/* /sys/kernel/debug/acpi/custom_method */ 18/* /sys/kernel/debug/acpi/custom_method */
24 19
@@ -80,23 +75,22 @@ static const struct file_operations cm_fops = {
80 .llseek = default_llseek, 75 .llseek = default_llseek,
81}; 76};
82 77
83int __init acpi_debugfs_init(void) 78static int __init acpi_custom_method_init(void)
84{ 79{
85 struct dentry *acpi_dir, *cm_dentry; 80 if (!acpi_debugfs_dir)
86 81 return -ENOENT;
87 acpi_dir = debugfs_create_dir("acpi", NULL);
88 if (!acpi_dir)
89 goto err;
90 82
91 cm_dentry = debugfs_create_file("custom_method", S_IWUSR, 83 cm_dentry = debugfs_create_file("custom_method", S_IWUSR,
92 acpi_dir, NULL, &cm_fops); 84 acpi_debugfs_dir, NULL, &cm_fops);
93 if (!cm_dentry) 85 if (!cm_dentry)
94 goto err; 86 return -ENODEV;
95 87
96 return 0; 88 return 0;
89}
90
91void __init acpi_debugfs_init(void)
92{
93 acpi_debugfs_dir = debugfs_create_dir("acpi", NULL);
97 94
98err: 95 acpi_custom_method_init();
99 if (acpi_dir)
100 debugfs_remove(acpi_dir);
101 return -EINVAL;
102} 96}