提交 8b18085a 编写于 作者: W Wim Van Sebroeck

watchdog: booke_wdt: fix ioctl status flags

The WDIOC_GETSTATUS & WDIOC_GETBOOTSTATUS ioctl calls return the WDIOF_* flags
and nothing else.
Signed-off-by: NWim Van Sebroeck <wim@iguana.be>
上级 76550d32
...@@ -137,12 +137,12 @@ static long booke_wdt_ioctl(struct file *file, ...@@ -137,12 +137,12 @@ static long booke_wdt_ioctl(struct file *file,
if (copy_to_user((void *)arg, &ident, sizeof(ident))) if (copy_to_user((void *)arg, &ident, sizeof(ident)))
return -EFAULT; return -EFAULT;
case WDIOC_GETSTATUS: case WDIOC_GETSTATUS:
return put_user(ident.options, 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 1 if last reset was caused by the WDT */ /* returns CARDRESET if last reset was caused by the WDT */
return (tmp ? 1 : 0); return (tmp ? WDIOF_CARDRESET : 0);
case WDIOC_SETOPTIONS: case WDIOC_SETOPTIONS:
if (get_user(tmp, p)) if (get_user(tmp, p))
return -EINVAL; return -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册