diff options
| -rw-r--r-- | 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 e990e3af8be4..7b4812776382 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, | |||
| 132 | unsigned int cmd, unsigned long arg) | 132 | unsigned int cmd, unsigned long arg) |
| 133 | { | 133 | { |
| 134 | int timeout; | 134 | int timeout; |
| 135 | int options; | ||
| 135 | void __user *argp = (void __user *)arg; | 136 | void __user *argp = (void __user *)arg; |
| 136 | static struct watchdog_info info = { | 137 | static struct watchdog_info info = { |
| 137 | .options = WDIOF_SETTIMEOUT | | 138 | .options = WDIOF_SETTIMEOUT | |
| @@ -157,7 +158,15 @@ static int mv64x60_wdt_ioctl(struct inode *inode, struct file *file, | |||
| 157 | return -EOPNOTSUPP; | 158 | return -EOPNOTSUPP; |
| 158 | 159 | ||
| 159 | case WDIOC_SETOPTIONS: | 160 | case WDIOC_SETOPTIONS: |
| 160 | return -EOPNOTSUPP; | 161 | if (get_user(options, (int __user *)argp)) |
| 162 | return -EFAULT; | ||
| 163 | |||
| 164 | if (options & WDIOS_DISABLECARD) | ||
| 165 | mv64x60_wdt_handler_disable(); | ||
| 166 | |||
| 167 | if (options & WDIOS_ENABLECARD) | ||
| 168 | mv64x60_wdt_handler_enable(); | ||
| 169 | break; | ||
| 161 | 170 | ||
| 162 | case WDIOC_KEEPALIVE: | 171 | case WDIOC_KEEPALIVE: |
| 163 | mv64x60_wdt_service(); | 172 | mv64x60_wdt_service(); |
