Commit 4ef2db016aab27af05a95aeab1c30ad3f2fed7b9

Authored by Rusty Russell
1 parent 57ba4717f2

param: update drivers/acpi/debug.c to new scheme

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>

Showing 1 changed file with 24 additions and 8 deletions Side-by-side Diff

drivers/acpi/debug.c
... ... @@ -96,7 +96,8 @@
96 96 /* --------------------------------------------------------------------------
97 97 FS Interface (/sys)
98 98 -------------------------------------------------------------------------- */
99   -static int param_get_debug_layer(char *buffer, struct kernel_param *kp) {
  99 +static int param_get_debug_layer(char *buffer, const struct kernel_param *kp)
  100 +{
100 101 int result = 0;
101 102 int i;
102 103  
... ... @@ -118,7 +119,8 @@
118 119 return result;
119 120 }
120 121  
121   -static int param_get_debug_level(char *buffer, struct kernel_param *kp) {
  122 +static int param_get_debug_level(char *buffer, const struct kernel_param *kp)
  123 +{
122 124 int result = 0;
123 125 int i;
124 126  
125 127  
... ... @@ -137,9 +139,19 @@
137 139 return result;
138 140 }
139 141  
140   -module_param_call(debug_layer, param_set_uint, param_get_debug_layer, &acpi_dbg_layer, 0644);
141   -module_param_call(debug_level, param_set_uint, param_get_debug_level, &acpi_dbg_level, 0644);
  142 +static struct kernel_param_ops acpi_debug_layer_ops = {
  143 + .set = param_set_uint,
  144 + .get = param_get_debug_layer,
  145 +};
142 146  
  147 +static struct kernel_param_ops acpi_debug_level_ops = {
  148 + .set = param_set_uint,
  149 + .get = param_get_debug_level,
  150 +};
  151 +
  152 +module_param_cb(debug_layer, &acpi_debug_layer_ops, &acpi_dbg_layer, 0644);
  153 +module_param_cb(debug_level, &acpi_debug_level_ops, &acpi_dbg_level, 0644);
  154 +
143 155 static char trace_method_name[6];
144 156 module_param_string(trace_method_name, trace_method_name, 6, 0644);
145 157 static unsigned int trace_debug_layer;
... ... @@ -147,7 +159,7 @@
147 159 static unsigned int trace_debug_level;
148 160 module_param(trace_debug_level, uint, 0644);
149 161  
150   -static int param_set_trace_state(const char *val, struct kernel_param *kp)
  162 +static int param_set_trace_state(const char *val, const struct kernel_param *kp)
151 163 {
152 164 int result = 0;
153 165  
... ... @@ -181,7 +193,7 @@
181 193 return result;
182 194 }
183 195  
184   -static int param_get_trace_state(char *buffer, struct kernel_param *kp)
  196 +static int param_get_trace_state(char *buffer, const struct kernel_param *kp)
185 197 {
186 198 if (!acpi_gbl_trace_method_name)
187 199 return sprintf(buffer, "disable");
... ... @@ -194,8 +206,12 @@
194 206 return 0;
195 207 }
196 208  
197   -module_param_call(trace_state, param_set_trace_state, param_get_trace_state,
198   - NULL, 0644);
  209 +static struct kernel_param_ops param_ops_trace_state = {
  210 + .set = param_set_trace_state,
  211 + .get = param_get_trace_state,
  212 +};
  213 +
  214 +module_param_cb(trace_state, &param_ops_trace_state, NULL, 0644);
199 215  
200 216 /* --------------------------------------------------------------------------
201 217 DebugFS Interface