示例#1
0
/*
 * mc poll_msec time value
 */
static ssize_t poll_msec_int_store(void *ptr, const char *buffer, size_t count)
{
    int *value = (int *)ptr;

    if (isdigit(*buffer)) {
        *value = simple_strtoul(buffer, NULL, 0);

        /* notify edac_mc engine to reset the poll period */
        edac_mc_reset_delay_period(*value);
    }

    return count;
}
static int edac_set_poll_msec(const char *val, struct kernel_param *kp)
{
	long l;
	int ret;

	if (!val)
		return -EINVAL;

	ret = strict_strtol(val, 0, &l);
	if (ret == -EINVAL || ((int)l != l))
		return -EINVAL;
	*((int *)kp->arg) = l;

	/* notify edac_mc engine to reset the poll period */
	edac_mc_reset_delay_period(l);

	return 0;
}
示例#3
0
static int edac_set_poll_msec(const char *val, struct kernel_param *kp)
{
	unsigned long l;
	int ret;

	if (!val)
		return -EINVAL;

	ret = kstrtoul(val, 0, &l);
	if (ret)
		return ret;

	if (l < 1000)
		return -EINVAL;

	*((unsigned long *)kp->arg) = l;

	/* notify edac_mc engine to reset the poll period */
	edac_mc_reset_delay_period(l);

	return 0;
}