X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=drivers%2Facpi%2Fdebug.c;h=d48f65a8f6587122be909ff286280203011f6bf5;hb=8a03d9a498eaf02c8a118752050a5154852c13bf;hp=263322b7d113d743caa9200ce7b9b8c592cd284b;hpb=0d9136fdbcdbddcd4eb5ac94c248c039193d4795;p=linux-2.6-omap-h63xx.git diff --git a/drivers/acpi/debug.c b/drivers/acpi/debug.c index 263322b7d11..d48f65a8f65 100644 --- a/drivers/acpi/debug.c +++ b/drivers/acpi/debug.c @@ -13,14 +13,11 @@ #define _COMPONENT ACPI_SYSTEM_COMPONENT ACPI_MODULE_NAME("debug") -#define ACPI_SYSTEM_FILE_DEBUG_LAYER "debug_layer" -#define ACPI_SYSTEM_FILE_DEBUG_LEVEL "debug_level" + #ifdef MODULE_PARAM_PREFIX #undef MODULE_PARAM_PREFIX #endif -#define MODULE_PARAM_PREFIX - module_param(acpi_dbg_layer, uint, 0400); -module_param(acpi_dbg_level, uint, 0400); +#define MODULE_PARAM_PREFIX "acpi." struct acpi_dlayer { const char *name; @@ -86,6 +83,60 @@ static const struct acpi_dlevel acpi_debug_levels[] = { ACPI_DEBUG_INIT(ACPI_LV_EVENTS), }; +/* -------------------------------------------------------------------------- + FS Interface (/sys) + -------------------------------------------------------------------------- */ +static int param_get_debug_layer(char *buffer, struct kernel_param *kp) { + int result = 0; + int i; + + result = sprintf(buffer, "%-25s\tHex SET\n", "Description"); + + for(i = 0; i sizeof(debug_string) - 1) - return_VALUE(-EINVAL); + return -EINVAL; if (copy_from_user(debug_string, buffer, count)) - return_VALUE(-EFAULT); + return -EFAULT; debug_string[count] = '\0'; @@ -173,10 +223,10 @@ acpi_system_write_debug(struct file *file, acpi_dbg_level = simple_strtoul(debug_string, NULL, 0); break; default: - return_VALUE(-EINVAL); + return -EINVAL; } - return_VALUE(count); + return count; } static int __init acpi_debug_init(void) @@ -185,10 +235,9 @@ static int __init acpi_debug_init(void) int error = 0; char *name; - ACPI_FUNCTION_TRACE("acpi_debug_init"); if (acpi_disabled) - return_VALUE(0); + return 0; /* 'debug_layer' [R/W] */ name = ACPI_SYSTEM_FILE_DEBUG_LAYER; @@ -213,16 +262,14 @@ static int __init acpi_debug_init(void) goto Error; Done: - return_VALUE(error); + return error; Error: - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "Unable to create '%s' proc fs entry\n", name)); - remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LEVEL, acpi_root_dir); remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LAYER, acpi_root_dir); - error = -EFAULT; + error = -ENODEV; goto Done; } subsys_initcall(acpi_debug_init); +#endif