Dan Carpenter a20a99fbb8 watchdog: ts72xx_wdt: cleanup return codes in ioctl
There seems to be some confusion here which functions return positive
numbers and which return negative error codes.

copy_to_user() returns the number of bytes remaining to be copied but we
want to return -EFAULT.

The rest is just clean up.  get_user() actually returns zero on success
and -EFAULT on error so we can preserve the error code.  The
timeout_to_regval() function returns -EINVAL on failure, but we can
propogate that back instead of hardcoding -EINVAL ourselves.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
--
2013-11-17 19:36:59 +01:00
..
2012-11-28 12:00:24 -08:00
2012-03-27 20:06:02 +02:00
2012-11-28 12:00:24 -08:00
2012-11-28 12:00:24 -08:00
2012-11-28 12:00:24 -08:00
2012-11-28 12:00:24 -08:00
2012-11-28 12:00:24 -08:00
2012-03-27 20:06:02 +02:00
2012-11-28 12:00:24 -08:00
2012-03-27 20:06:02 +02:00
2012-03-27 20:06:02 +02:00
2012-03-27 20:06:02 +02:00
2013-11-17 19:34:20 +01:00
2012-03-27 20:06:02 +02:00
2013-11-17 19:36:38 +01:00
2012-11-28 12:00:24 -08:00
2012-03-28 15:58:21 -07:00
2013-11-17 19:36:38 +01:00
2013-11-17 19:34:20 +01:00
2012-11-28 12:00:24 -08:00
2012-03-27 20:06:02 +02:00
2013-11-17 19:34:20 +01:00
2012-11-28 12:00:24 -08:00
2012-03-27 20:06:02 +02:00
2012-11-28 12:00:24 -08:00
2012-03-27 20:06:02 +02:00
2013-11-17 19:34:20 +01:00
2013-03-01 12:31:14 +01:00
2012-03-28 15:58:21 -07:00
2012-03-27 20:06:02 +02:00
2012-03-27 20:06:02 +02:00
2012-03-27 20:06:02 +02:00
2013-11-17 19:34:20 +01:00
2012-11-28 12:00:24 -08:00
2012-03-27 20:06:02 +02:00
2012-03-28 15:58:21 -07:00
2012-03-28 15:58:21 -07:00
2012-11-28 12:00:24 -08:00
2012-03-28 15:58:21 -07:00
2013-11-17 19:34:20 +01:00
2012-11-28 12:00:24 -08:00
2012-11-28 12:00:24 -08:00