Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=85d57238d2ff9d95892dd1f266b85d2359d48dcc
Commit:     85d57238d2ff9d95892dd1f266b85d2359d48dcc
Parent:     94796f908788b3ea2b6e60e5272f4e26cea3fc22
Author:     Dale Farnsworth <[EMAIL PROTECTED]>
AuthorDate: Tue Jul 24 11:16:29 2007 -0700
Committer:  Wim Van Sebroeck <[EMAIL PROTECTED]>
CommitDate: Tue Jul 24 21:16:15 2007 +0000

    [WATCHDOG] mv64x60_wdt: Add WDIOC_SETOPTIONS ioctl support
    
    Allow the watchdog timer to be enabled or disabled via the
    WDIOC_SETOPTIONS ioctl.
    
    Signed-off-by: Dale Farnsworth <[EMAIL PROTECTED]>
    Signed-off-by: Wim Van Sebroeck <[EMAIL PROTECTED]>
---
 drivers/char/watchdog/mv64x60_wdt.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/drivers/char/watchdog/mv64x60_wdt.c 
b/drivers/char/watchdog/mv64x60_wdt.c
index e990e3a..7b48127 100644
--- a/drivers/char/watchdog/mv64x60_wdt.c
+++ b/drivers/char/watchdog/mv64x60_wdt.c
@@ -132,6 +132,7 @@ static int mv64x60_wdt_ioctl(struct inode *inode, struct 
file *file,
                             unsigned int cmd, unsigned long arg)
 {
        int timeout;
+       int options;
        void __user *argp = (void __user *)arg;
        static struct watchdog_info info = {
                .options =      WDIOF_SETTIMEOUT        |
@@ -157,7 +158,15 @@ static int mv64x60_wdt_ioctl(struct inode *inode, struct 
file *file,
                return -EOPNOTSUPP;
 
        case WDIOC_SETOPTIONS:
-               return -EOPNOTSUPP;
+               if (get_user(options, (int __user *)argp))
+                       return -EFAULT;
+
+               if (options & WDIOS_DISABLECARD)
+                       mv64x60_wdt_handler_disable();
+
+               if (options & WDIOS_ENABLECARD)
+                       mv64x60_wdt_handler_enable();
+               break;
 
        case WDIOC_KEEPALIVE:
                mv64x60_wdt_service();
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to