diff options
Diffstat (limited to 'drivers/edac/edac_mc_sysfs.c')
-rw-r--r-- | drivers/edac/edac_mc_sysfs.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c index 021d18795145..7bb9c1532b90 100644 --- a/drivers/edac/edac_mc_sysfs.c +++ b/drivers/edac/edac_mc_sysfs.c | |||
@@ -44,6 +44,25 @@ int edac_mc_get_poll_msec(void) | |||
44 | return edac_mc_poll_msec; | 44 | return edac_mc_poll_msec; |
45 | } | 45 | } |
46 | 46 | ||
47 | static int edac_set_poll_msec(const char *val, struct kernel_param *kp) | ||
48 | { | ||
49 | long l; | ||
50 | int ret; | ||
51 | |||
52 | if (!val) | ||
53 | return -EINVAL; | ||
54 | |||
55 | ret = strict_strtol(val, 0, &l); | ||
56 | if (ret == -EINVAL || ((int)l != l)) | ||
57 | return -EINVAL; | ||
58 | *((int *)kp->arg) = l; | ||
59 | |||
60 | /* notify edac_mc engine to reset the poll period */ | ||
61 | edac_mc_reset_delay_period(l); | ||
62 | |||
63 | return 0; | ||
64 | } | ||
65 | |||
47 | /* Parameter declarations for above */ | 66 | /* Parameter declarations for above */ |
48 | module_param(edac_mc_panic_on_ue, int, 0644); | 67 | module_param(edac_mc_panic_on_ue, int, 0644); |
49 | MODULE_PARM_DESC(edac_mc_panic_on_ue, "Panic on uncorrected error: 0=off 1=on"); | 68 | MODULE_PARM_DESC(edac_mc_panic_on_ue, "Panic on uncorrected error: 0=off 1=on"); |
@@ -53,7 +72,8 @@ MODULE_PARM_DESC(edac_mc_log_ue, | |||
53 | module_param(edac_mc_log_ce, int, 0644); | 72 | module_param(edac_mc_log_ce, int, 0644); |
54 | MODULE_PARM_DESC(edac_mc_log_ce, | 73 | MODULE_PARM_DESC(edac_mc_log_ce, |
55 | "Log correctable error to console: 0=off 1=on"); | 74 | "Log correctable error to console: 0=off 1=on"); |
56 | module_param(edac_mc_poll_msec, int, 0644); | 75 | module_param_call(edac_mc_poll_msec, edac_set_poll_msec, param_get_int, |
76 | &edac_mc_poll_msec, 0644); | ||
57 | MODULE_PARM_DESC(edac_mc_poll_msec, "Polling period in milliseconds"); | 77 | MODULE_PARM_DESC(edac_mc_poll_msec, "Polling period in milliseconds"); |
58 | 78 | ||
59 | /* | 79 | /* |