Re: [PATCH 02/11] watchdog: WatchDog Timer Driver Core - Add basic ioctl functionality

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +static long watchdog_ioctl(struct file *file, unsigned int cmd,
> +							unsigned long arg)
> +{
> +	void __user *argp = (void __user *)arg;
> +	int __user *p = argp;
> +	unsigned int val;
> +
> +	switch (cmd) {
> +	case WDIOC_GETSUPPORT:
> +		return copy_to_user(argp, wdd->info,
> +			sizeof(struct watchdog_info)) ? -EFAULT : 0;
> +	case WDIOC_GETSTATUS:
> +		val = wdd->ops->status ? wdd->ops->status(wdd) : 0;
> +		return put_user(val, p);
> +	case WDIOC_GETBOOTSTATUS:
> +		return put_user(wdd->bootstatus, p);
> +	default:
> +		return -ENOTTY;
> +	}
> +	return -ENOTTY;

I think one of the -ENOTTY could be removed?

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux