From 78d88fc01202b088573c962e2885556a5e99bf74 Mon Sep 17 00:00:00 2001 From: Wim Van Sebroeck Date: Fri, 22 Jul 2011 18:59:49 +0000 Subject: watchdog: WatchDog Timer Driver Core - Add ioctl call Add support for extra ioctl calls by adding a ioctl watchdog operation. This operation will be called before we do our own handling of ioctl commands. This way we can override the internal ioctl command handling and we can also add extra ioctl commands. The ioctl watchdog operation should return the appropriate error codes or -ENOIOCTLCMD if the ioctl command should be handled through the internal ioctl handling of the framework. Signed-off-by: Alan Cox Signed-off-by: Wim Van Sebroeck Acked-by: Arnd Bergmann Acked-by: Wolfram Sang --- drivers/watchdog/watchdog_dev.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers') diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c index ac20f92347b1..e7134a5979c6 100644 --- a/drivers/watchdog/watchdog_dev.c +++ b/drivers/watchdog/watchdog_dev.c @@ -180,6 +180,12 @@ static long watchdog_ioctl(struct file *file, unsigned int cmd, unsigned int val; int err; + if (wdd->ops->ioctl) { + err = wdd->ops->ioctl(wdd, cmd, arg); + if (err != -ENOIOCTLCMD) + return err; + } + switch (cmd) { case WDIOC_GETSUPPORT: return copy_to_user(argp, wdd->info, -- cgit v1.2.3-59-g8ed1b