watchdog: Add support for WDIOC_GETTIMELEFT IOCTL in watchdog core

This patch adds support for WDIOC_GETTIMELEFT IOCTL in watchdog core. So, there
is another function pointer added to struct watchdog_ops, which can be passed by
drivers to support this IOCTL.

Related documentation is updated too.

Signed-off-by: Viresh Kumar <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Signed-off-by: Wim Van Sebroeck <[email protected]>
This commit is contained in:
Viresh Kumar 2012-03-16 09:14:00 +01:00 • committed by Wim Van Sebroeck
commit fd7b673c92
4 changed files with 14 additions and 1 deletions

View file

@ -236,6 +236,11 @@ static long watchdog_ioctl(struct file *file, unsigned int cmd,
if (wdd->timeout == 0)
return -EOPNOTSUPP;
return put_user(wdd->timeout, p);
case WDIOC_GETTIMELEFT:
if (!wdd->ops->get_timeleft)
return -EOPNOTSUPP;
return put_user(wdd->ops->get_timeleft(wdd), p);
default:
return -ENOTTY;
}