aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/ipmi
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-12 13:01:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-12 13:01:59 -0400
commit26df0766a73a859bb93dc58e747c5028557a23fd (patch)
tree4776de567425a7fb66ca9a87228309f9c84de633 /drivers/char/ipmi
parent580287628cdd99366b10c9050c4479b387283be8 (diff)
parenta6de51b2787012ba3ab62c7d50df1b749b83d5f0 (diff)
Merge branch 'params' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
* 'params' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus: (22 commits) param: don't deref arg in __same_type() checks param: update drivers/acpi/debug.c to new scheme param: use module_param in drivers/message/fusion/mptbase.c ide: use module_param_named rather than module_param_call param: update drivers/char/ipmi/ipmi_watchdog.c to new scheme param: lock if_sdio's lbs_helper_name and lbs_fw_name against sysfs changes. param: lock myri10ge_fw_name against sysfs changes. param: simple locking for sysfs-writable charp parameters param: remove unnecessary writable charp param: add kerneldoc to moduleparam.h param: locking for kernel parameters param: make param sections const. param: use free hook for charp (fix leak of charp parameters) param: add a free hook to kernel_param_ops. param: silence .init.text references from param ops Add param ops struct for hvc_iucv driver. nfs: update for module_param_named API change AppArmor: update for module_param_named API change param: use ops in struct kernel_param, rather than get and set fns directly param: move the EXPORT_SYMBOL to after the definitions. ...
Diffstat (limited to 'drivers/char/ipmi')
-rw-r--r--drivers/char/ipmi/ipmi_watchdog.c42
1 files changed, 27 insertions, 15 deletions
diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c
index 82bcdb262a3..654d566ca57 100644
--- a/drivers/char/ipmi/ipmi_watchdog.c
+++ b/drivers/char/ipmi/ipmi_watchdog.c
@@ -196,7 +196,7 @@ static void ipmi_unregister_watchdog(int ipmi_intf);
196 */ 196 */
197static int start_now; 197static int start_now;
198 198
199static int set_param_int(const char *val, struct kernel_param *kp) 199static int set_param_timeout(const char *val, const struct kernel_param *kp)
200{ 200{
201 char *endp; 201 char *endp;
202 int l; 202 int l;
@@ -215,10 +215,11 @@ static int set_param_int(const char *val, struct kernel_param *kp)
215 return rv; 215 return rv;
216} 216}
217 217
218static int get_param_int(char *buffer, struct kernel_param *kp) 218static struct kernel_param_ops param_ops_timeout = {
219{ 219 .set = set_param_timeout,
220 return sprintf(buffer, "%i", *((int *)kp->arg)); 220 .get = param_get_int,
221} 221};
222#define param_check_timeout param_check_int
222 223
223typedef int (*action_fn)(const char *intval, char *outval); 224typedef int (*action_fn)(const char *intval, char *outval);
224 225
@@ -227,7 +228,7 @@ static int preaction_op(const char *inval, char *outval);
227static int preop_op(const char *inval, char *outval); 228static int preop_op(const char *inval, char *outval);
228static void check_parms(void); 229static void check_parms(void);
229 230
230static int set_param_str(const char *val, struct kernel_param *kp) 231static int set_param_str(const char *val, const struct kernel_param *kp)
231{ 232{
232 action_fn fn = (action_fn) kp->arg; 233 action_fn fn = (action_fn) kp->arg;
233 int rv = 0; 234 int rv = 0;
@@ -251,7 +252,7 @@ static int set_param_str(const char *val, struct kernel_param *kp)
251 return rv; 252 return rv;
252} 253}
253 254
254static int get_param_str(char *buffer, struct kernel_param *kp) 255static int get_param_str(char *buffer, const struct kernel_param *kp)
255{ 256{
256 action_fn fn = (action_fn) kp->arg; 257 action_fn fn = (action_fn) kp->arg;
257 int rv; 258 int rv;
@@ -263,7 +264,7 @@ static int get_param_str(char *buffer, struct kernel_param *kp)
263} 264}
264 265
265 266
266static int set_param_wdog_ifnum(const char *val, struct kernel_param *kp) 267static int set_param_wdog_ifnum(const char *val, const struct kernel_param *kp)
267{ 268{
268 int rv = param_set_int(val, kp); 269 int rv = param_set_int(val, kp);
269 if (rv) 270 if (rv)
@@ -276,27 +277,38 @@ static int set_param_wdog_ifnum(const char *val, struct kernel_param *kp)
276 return 0; 277 return 0;
277} 278}
278 279
279module_param_call(ifnum_to_use, set_param_wdog_ifnum, get_param_int, 280static struct kernel_param_ops param_ops_wdog_ifnum = {
280 &ifnum_to_use, 0644); 281 .set = set_param_wdog_ifnum,
282 .get = param_get_int,
283};
284
285#define param_check_wdog_ifnum param_check_int
286
287static struct kernel_param_ops param_ops_str = {
288 .set = set_param_str,
289 .get = get_param_str,
290};
291
292module_param(ifnum_to_use, wdog_ifnum, 0644);
281MODULE_PARM_DESC(ifnum_to_use, "The interface number to use for the watchdog " 293MODULE_PARM_DESC(ifnum_to_use, "The interface number to use for the watchdog "
282 "timer. Setting to -1 defaults to the first registered " 294 "timer. Setting to -1 defaults to the first registered "
283 "interface"); 295 "interface");
284 296
285module_param_call(timeout, set_param_int, get_param_int, &timeout, 0644); 297module_param(timeout, timeout, 0644);
286MODULE_PARM_DESC(timeout, "Timeout value in seconds."); 298MODULE_PARM_DESC(timeout, "Timeout value in seconds.");
287 299
288module_param_call(pretimeout, set_param_int, get_param_int, &pretimeout, 0644); 300module_param(pretimeout, timeout, 0644);
289MODULE_PARM_DESC(pretimeout, "Pretimeout value in seconds."); 301MODULE_PARM_DESC(pretimeout, "Pretimeout value in seconds.");
290 302
291module_param_call(action, set_param_str, get_param_str, action_op, 0644); 303module_param_cb(action, &param_ops_str, action_op, 0644);
292MODULE_PARM_DESC(action, "Timeout action. One of: " 304MODULE_PARM_DESC(action, "Timeout action. One of: "
293 "reset, none, power_cycle, power_off."); 305 "reset, none, power_cycle, power_off.");
294 306
295module_param_call(preaction, set_param_str, get_param_str, preaction_op, 0644); 307module_param_cb(preaction, &param_ops_str, preaction_op, 0644);
296MODULE_PARM_DESC(preaction, "Pretimeout action. One of: " 308MODULE_PARM_DESC(preaction, "Pretimeout action. One of: "
297 "pre_none, pre_smi, pre_nmi, pre_int."); 309 "pre_none, pre_smi, pre_nmi, pre_int.");
298 310
299module_param_call(preop, set_param_str, get_param_str, preop_op, 0644); 311module_param_cb(preop, &param_ops_str, preop_op, 0644);
300MODULE_PARM_DESC(preop, "Pretimeout driver operation. One of: " 312MODULE_PARM_DESC(preop, "Pretimeout driver operation. One of: "
301 "preop_none, preop_panic, preop_give_data."); 313 "preop_none, preop_panic, preop_give_data.");
302 314