diff options
| -rw-r--r-- | drivers/acpi/debugfs.c | 32 | ||||
| -rw-r--r-- | drivers/acpi/internal.h | 3 | ||||
| -rw-r--r-- | 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 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 |
| 13 | ACPI_MODULE_NAME("debugfs"); | 13 | ACPI_MODULE_NAME("debugfs"); |
| 14 | 14 | ||
| 15 | 15 | struct dentry *acpi_debugfs_dir; | |
| 16 | /* /sys/modules/acpi/parameters/aml_debug_output */ | 16 | static struct dentry *cm_dentry; |
| 17 | |||
| 18 | module_param_named(aml_debug_output, acpi_gbl_enable_aml_debug_object, | ||
| 19 | bool, 0644); | ||
| 20 | MODULE_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 | ||
| 83 | int __init acpi_debugfs_init(void) | 78 | static 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 | |||
| 91 | void __init acpi_debugfs_init(void) | ||
| 92 | { | ||
| 93 | acpi_debugfs_dir = debugfs_create_dir("acpi", NULL); | ||
| 97 | 94 | ||
| 98 | err: | 95 | acpi_custom_method_init(); |
| 99 | if (acpi_dir) | ||
| 100 | debugfs_remove(acpi_dir); | ||
| 101 | return -EINVAL; | ||
| 102 | } | 96 | } |
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h index 4bfb759deb10..ca75b9ce0489 100644 --- a/drivers/acpi/internal.h +++ b/drivers/acpi/internal.h | |||
| @@ -28,9 +28,10 @@ int acpi_scan_init(void); | |||
| 28 | int acpi_sysfs_init(void); | 28 | int acpi_sysfs_init(void); |
| 29 | 29 | ||
| 30 | #ifdef CONFIG_DEBUG_FS | 30 | #ifdef CONFIG_DEBUG_FS |
| 31 | extern struct dentry *acpi_debugfs_dir; | ||
| 31 | int acpi_debugfs_init(void); | 32 | int acpi_debugfs_init(void); |
| 32 | #else | 33 | #else |
| 33 | static inline int acpi_debugfs_init(void) { return 0; } | 34 | static inline void acpi_debugfs_init(void) { return; } |
| 34 | #endif | 35 | #endif |
| 35 | 36 | ||
| 36 | /* -------------------------------------------------------------------------- | 37 | /* -------------------------------------------------------------------------- |
diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index 61891e75583d..77255f250dbb 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, | |||
| 220 | NULL, 0644); | 220 | NULL, 0644); |
| 221 | #endif /* CONFIG_ACPI_DEBUG */ | 221 | #endif /* CONFIG_ACPI_DEBUG */ |
| 222 | 222 | ||
| 223 | |||
| 224 | /* /sys/modules/acpi/parameters/aml_debug_output */ | ||
| 225 | |||
| 226 | module_param_named(aml_debug_output, acpi_gbl_enable_aml_debug_object, | ||
| 227 | bool, 0644); | ||
| 228 | MODULE_PARM_DESC(aml_debug_output, | ||
| 229 | "To enable/disable the ACPI Debug Object output."); | ||
| 230 | |||
| 223 | /* /sys/module/acpi/parameters/acpica_version */ | 231 | /* /sys/module/acpi/parameters/acpica_version */ |
| 224 | static int param_get_acpica_version(char *buffer, struct kernel_param *kp) | 232 | static int param_get_acpica_version(char *buffer, struct kernel_param *kp) |
| 225 | { | 233 | { |
