From: Dan Carpenter Date: Fri, 23 Aug 2013 09:38:32 +0000 (+0300) Subject: watchdog: ts72xx_wdt: cleanup return codes in ioctl X-Git-Tag: v3.13-rc1~42^2~16 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a20a99fbb88ac58c2e118e8759967d1cd7355322;p=pandora-kernel.git 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 Reviewed-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck -- --- Reading git-diff-tree failed