Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Thomas Renninger and committed by
Len Brown
aecad432 61c4f2c8

+23 -20
+13 -19
drivers/acpi/debugfs.c
··· 12 12 #define _COMPONENT ACPI_SYSTEM_COMPONENT 13 13 ACPI_MODULE_NAME("debugfs"); 14 14 15 - 16 - /* /sys/modules/acpi/parameters/aml_debug_output */ 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."); 15 + struct dentry *acpi_debugfs_dir; 16 + static struct dentry *cm_dentry; 22 17 23 18 /* /sys/kernel/debug/acpi/custom_method */ 24 19 ··· 75 80 .llseek = default_llseek, 76 81 }; 77 82 78 - int __init acpi_debugfs_init(void) 83 + static int __init acpi_custom_method_init(void) 79 84 { 80 - struct dentry *acpi_dir, *cm_dentry; 81 - 82 - acpi_dir = debugfs_create_dir("acpi", NULL); 83 - if (!acpi_dir) 84 - goto err; 85 + if (!acpi_debugfs_dir) 86 + return -ENOENT; 85 87 86 88 cm_dentry = debugfs_create_file("custom_method", S_IWUSR, 87 - acpi_dir, NULL, &cm_fops); 89 + acpi_debugfs_dir, NULL, &cm_fops); 88 90 if (!cm_dentry) 89 - goto err; 91 + return -ENODEV; 90 92 91 93 return 0; 94 + } 92 95 93 - err: 94 - if (acpi_dir) 95 - debugfs_remove(acpi_dir); 96 - return -EINVAL; 96 + void __init acpi_debugfs_init(void) 97 + { 98 + acpi_debugfs_dir = debugfs_create_dir("acpi", NULL); 99 + 100 + acpi_custom_method_init(); 97 101 }
+2 -1
drivers/acpi/internal.h
··· 28 28 int acpi_sysfs_init(void); 29 29 30 30 #ifdef CONFIG_DEBUG_FS 31 + extern struct dentry *acpi_debugfs_dir; 31 32 int acpi_debugfs_init(void); 32 33 #else 33 - static inline int acpi_debugfs_init(void) { return 0; } 34 + static inline void acpi_debugfs_init(void) { return; } 34 35 #endif 35 36 36 37 /* --------------------------------------------------------------------------
+8
drivers/acpi/sysfs.c
··· 220 220 NULL, 0644); 221 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 231 /* /sys/module/acpi/parameters/acpica_version */ 224 232 static int param_get_acpica_version(char *buffer, struct kernel_param *kp) 225 233 {