Commit 127c6e73 authored by Tiejun Chen's avatar Tiejun Chen Committed by Kumar Gala

booke/wdt: some ioctls do not return values properly

Fix some booke wdt ioctls return value error.
Signed-off-by: default avatarTiejun Chen <tiejun.chen@windriver.com>
Acked-by: default avatarTimur Tabi <timur@freescale.com>
Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
parent 09a3017a
...@@ -166,18 +166,17 @@ static long booke_wdt_ioctl(struct file *file, ...@@ -166,18 +166,17 @@ static long booke_wdt_ioctl(struct file *file,
switch (cmd) { switch (cmd) {
case WDIOC_GETSUPPORT: case WDIOC_GETSUPPORT:
if (copy_to_user((void *)arg, &ident, sizeof(ident))) return copy_to_user(p, &ident, sizeof(ident)) ? -EFAULT : 0;
return -EFAULT;
case WDIOC_GETSTATUS: case WDIOC_GETSTATUS:
return put_user(0, p); return put_user(0, p);
case WDIOC_GETBOOTSTATUS: case WDIOC_GETBOOTSTATUS:
/* XXX: something is clearing TSR */ /* XXX: something is clearing TSR */
tmp = mfspr(SPRN_TSR) & TSR_WRS(3); tmp = mfspr(SPRN_TSR) & TSR_WRS(3);
/* returns CARDRESET if last reset was caused by the WDT */ /* returns CARDRESET if last reset was caused by the WDT */
return (tmp ? WDIOF_CARDRESET : 0); return put_user((tmp ? WDIOF_CARDRESET : 0), p);
case WDIOC_SETOPTIONS: case WDIOC_SETOPTIONS:
if (get_user(tmp, p)) if (get_user(tmp, p))
return -EINVAL; return -EFAULT;
if (tmp == WDIOS_ENABLECARD) { if (tmp == WDIOS_ENABLECARD) {
booke_wdt_ping(); booke_wdt_ping();
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment