aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/watchdog_dev.c
diff options
context:
space:
mode:
authorWim Van Sebroeck <wim@iguana.be>2011-07-22 14:59:49 -0400
committerWim Van Sebroeck <wim@iguana.be>2011-07-28 04:01:16 -0400
commit78d88fc01202b088573c962e2885556a5e99bf74 (patch)
tree8f5650e80988752d144c4575ae4d2b4e846e2aa5 /drivers/watchdog/watchdog_dev.c
parent7e192b9c4234d29bdc20ac8d0a67edf7624b4206 (diff)
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 <alan@lxorguk.ukuu.org.uk> Signed-off-by: Wim Van Sebroeck <wim@iguana.be> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Diffstat (limited to 'drivers/watchdog/watchdog_dev.c')
-rw-r--r--drivers/watchdog/watchdog_dev.c6
1 files changed, 6 insertions, 0 deletions
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,
180 unsigned int val; 180 unsigned int val;
181 int err; 181 int err;
182 182
183 if (wdd->ops->ioctl) {
184 err = wdd->ops->ioctl(wdd, cmd, arg);
185 if (err != -ENOIOCTLCMD)
186 return err;
187 }
188
183 switch (cmd) { 189 switch (cmd) {
184 case WDIOC_GETSUPPORT: 190 case WDIOC_GETSUPPORT:
185 return copy_to_user(argp, wdd->info, 191 return copy_to_user(argp, wdd->info,