提交 aecad432 编写于 作者: T Thomas Renninger 提交者: Len Brown

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: NThomas Renninger <trenn@suse.de>
Acked-by: NRafael J. Wysocki <rjw@sisk.pl>
Acked-by: rui.zhang@intel.com
Signed-off-by: NLen Brown <len.brown@intel.com>
上级 61c4f2c8
...@@ -12,13 +12,8 @@ ...@@ -12,13 +12,8 @@
#define _COMPONENT ACPI_SYSTEM_COMPONENT #define _COMPONENT ACPI_SYSTEM_COMPONENT
ACPI_MODULE_NAME("debugfs"); ACPI_MODULE_NAME("debugfs");
struct dentry *acpi_debugfs_dir;
/* /sys/modules/acpi/parameters/aml_debug_output */ static struct dentry *cm_dentry;
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/kernel/debug/acpi/custom_method */ /* /sys/kernel/debug/acpi/custom_method */
...@@ -80,23 +75,22 @@ static const struct file_operations cm_fops = { ...@@ -80,23 +75,22 @@ static const struct file_operations cm_fops = {
.llseek = default_llseek, .llseek = default_llseek,
}; };
int __init acpi_debugfs_init(void) static int __init acpi_custom_method_init(void)
{ {
struct dentry *acpi_dir, *cm_dentry; if (!acpi_debugfs_dir)
return -ENOENT;
acpi_dir = debugfs_create_dir("acpi", NULL);
if (!acpi_dir)
goto err;
cm_dentry = debugfs_create_file("custom_method", S_IWUSR, cm_dentry = debugfs_create_file("custom_method", S_IWUSR,
acpi_dir, NULL, &cm_fops); acpi_debugfs_dir, NULL, &cm_fops);
if (!cm_dentry) if (!cm_dentry)
goto err; return -ENODEV;
return 0; return 0;
}
void __init acpi_debugfs_init(void)
{
acpi_debugfs_dir = debugfs_create_dir("acpi", NULL);
err: acpi_custom_method_init();
if (acpi_dir)
debugfs_remove(acpi_dir);
return -EINVAL;
} }
...@@ -28,9 +28,10 @@ int acpi_scan_init(void); ...@@ -28,9 +28,10 @@ int acpi_scan_init(void);
int acpi_sysfs_init(void); int acpi_sysfs_init(void);
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
extern struct dentry *acpi_debugfs_dir;
int acpi_debugfs_init(void); int acpi_debugfs_init(void);
#else #else
static inline int acpi_debugfs_init(void) { return 0; } static inline void acpi_debugfs_init(void) { return; }
#endif #endif
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
......
...@@ -220,6 +220,14 @@ module_param_call(trace_state, param_set_trace_state, param_get_trace_state, ...@@ -220,6 +220,14 @@ module_param_call(trace_state, param_set_trace_state, param_get_trace_state,
NULL, 0644); NULL, 0644);
#endif /* CONFIG_ACPI_DEBUG */ #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 */ /* /sys/module/acpi/parameters/acpica_version */
static int param_get_acpica_version(char *buffer, struct kernel_param *kp) static int param_get_acpica_version(char *buffer, struct kernel_param *kp)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册