Skip to content

Commit

Permalink
param: update drivers/acpi/debug.c to new scheme
Browse files Browse the repository at this point in the history
The new module_param_cb() uses an ops struct, and the ops take a
const struct kernel_param pointer (it's in .rodata).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
Rusty Russell committed Aug 11, 2010
1 parent 57ba471 commit 4ef2db0
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions drivers/acpi/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ static const struct acpi_dlevel acpi_debug_levels[] = {
/* --------------------------------------------------------------------------
FS Interface (/sys)
-------------------------------------------------------------------------- */
static int param_get_debug_layer(char *buffer, struct kernel_param *kp) {
static int param_get_debug_layer(char *buffer, const struct kernel_param *kp)
{
int result = 0;
int i;

Expand All @@ -118,7 +119,8 @@ static int param_get_debug_layer(char *buffer, struct kernel_param *kp) {
return result;
}

static int param_get_debug_level(char *buffer, struct kernel_param *kp) {
static int param_get_debug_level(char *buffer, const struct kernel_param *kp)
{
int result = 0;
int i;

Expand All @@ -137,8 +139,18 @@ static int param_get_debug_level(char *buffer, struct kernel_param *kp) {
return result;
}

module_param_call(debug_layer, param_set_uint, param_get_debug_layer, &acpi_dbg_layer, 0644);
module_param_call(debug_level, param_set_uint, param_get_debug_level, &acpi_dbg_level, 0644);
static struct kernel_param_ops acpi_debug_layer_ops = {
.set = param_set_uint,
.get = param_get_debug_layer,
};

static struct kernel_param_ops acpi_debug_level_ops = {
.set = param_set_uint,
.get = param_get_debug_level,
};

module_param_cb(debug_layer, &acpi_debug_layer_ops, &acpi_dbg_layer, 0644);
module_param_cb(debug_level, &acpi_debug_level_ops, &acpi_dbg_level, 0644);

static char trace_method_name[6];
module_param_string(trace_method_name, trace_method_name, 6, 0644);
Expand All @@ -147,7 +159,7 @@ module_param(trace_debug_layer, uint, 0644);
static unsigned int trace_debug_level;
module_param(trace_debug_level, uint, 0644);

static int param_set_trace_state(const char *val, struct kernel_param *kp)
static int param_set_trace_state(const char *val, const struct kernel_param *kp)
{
int result = 0;

Expand Down Expand Up @@ -181,7 +193,7 @@ static int param_set_trace_state(const char *val, struct kernel_param *kp)
return result;
}

static int param_get_trace_state(char *buffer, struct kernel_param *kp)
static int param_get_trace_state(char *buffer, const struct kernel_param *kp)
{
if (!acpi_gbl_trace_method_name)
return sprintf(buffer, "disable");
Expand All @@ -194,8 +206,12 @@ static int param_get_trace_state(char *buffer, struct kernel_param *kp)
return 0;
}

module_param_call(trace_state, param_set_trace_state, param_get_trace_state,
NULL, 0644);
static struct kernel_param_ops param_ops_trace_state = {
.set = param_set_trace_state,
.get = param_get_trace_state,
};

module_param_cb(trace_state, &param_ops_trace_state, NULL, 0644);

/* --------------------------------------------------------------------------
DebugFS Interface
Expand Down

0 comments on commit 4ef2db0

Please sign in to comment.