aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/mv64x60_wdt.c
diff options
context:
space:
mode:
authorAlan Cox <alan@redhat.com>2008-05-19 09:07:26 -0400
committerWim Van Sebroeck <wim@iguana.be>2008-06-13 16:02:51 -0400
commita86b849868f40f83781f7a7e32e5e5ef939dc570 (patch)
treefe26884098aad323d860bd15936f0bf37620935c /drivers/watchdog/mv64x60_wdt.c
parented78c2da14924793310d96fa4b6a8c3a4172f72f (diff)
[WATCHDOG 29/57] mv64x60_wdt: clean up and locking checks
Review and switch to unlocked_ioctl Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/mv64x60_wdt.c')
-rw-r--r--drivers/watchdog/mv64x60_wdt.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/watchdog/mv64x60_wdt.c b/drivers/watchdog/mv64x60_wdt.c
index b59ca3273967..ac09fe4d9573 100644
--- a/drivers/watchdog/mv64x60_wdt.c
+++ b/drivers/watchdog/mv64x60_wdt.c
@@ -8,7 +8,7 @@
8 * and services the watchdog. 8 * and services the watchdog.
9 * 9 *
10 * Derived from mpc8xx_wdt.c, with the following copyright. 10 * Derived from mpc8xx_wdt.c, with the following copyright.
11 * 11 *
12 * 2002 (c) Florian Schirmer <jolt@tuxbox.org> This file is licensed under 12 * 2002 (c) Florian Schirmer <jolt@tuxbox.org> This file is licensed under
13 * the terms of the GNU General Public License version 2. This program 13 * the terms of the GNU General Public License version 2. This program
14 * is licensed "as is" without any warranty of any kind, whether express 14 * is licensed "as is" without any warranty of any kind, whether express
@@ -24,8 +24,8 @@
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25 25
26#include <linux/mv643xx.h> 26#include <linux/mv643xx.h>
27#include <asm/uaccess.h> 27#include <linux/uaccess.h>
28#include <asm/io.h> 28#include <linux/io.h>
29 29
30#define MV64x60_WDT_WDC_OFFSET 0 30#define MV64x60_WDT_WDC_OFFSET 0
31 31
@@ -61,7 +61,9 @@ static DEFINE_SPINLOCK(mv64x60_wdt_spinlock);
61 61
62static int nowayout = WATCHDOG_NOWAYOUT; 62static int nowayout = WATCHDOG_NOWAYOUT;
63module_param(nowayout, int, 0); 63module_param(nowayout, int, 0);
64MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); 64MODULE_PARM_DESC(nowayout,
65 "Watchdog cannot be stopped once started (default="
66 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
65 67
66static int mv64x60_wdt_toggle_wdc(int enabled_predicate, int field_shift) 68static int mv64x60_wdt_toggle_wdc(int enabled_predicate, int field_shift)
67{ 69{
@@ -150,7 +152,7 @@ static int mv64x60_wdt_release(struct inode *inode, struct file *file)
150} 152}
151 153
152static ssize_t mv64x60_wdt_write(struct file *file, const char __user *data, 154static ssize_t mv64x60_wdt_write(struct file *file, const char __user *data,
153 size_t len, loff_t * ppos) 155 size_t len, loff_t *ppos)
154{ 156{
155 if (len) { 157 if (len) {
156 if (!nowayout) { 158 if (!nowayout) {
@@ -160,7 +162,7 @@ static ssize_t mv64x60_wdt_write(struct file *file, const char __user *data,
160 162
161 for (i = 0; i != len; i++) { 163 for (i = 0; i != len; i++) {
162 char c; 164 char c;
163 if(get_user(c, data + i)) 165 if (get_user(c, data + i))
164 return -EFAULT; 166 return -EFAULT;
165 if (c == 'V') 167 if (c == 'V')
166 expect_close = 42; 168 expect_close = 42;
@@ -172,8 +174,8 @@ static ssize_t mv64x60_wdt_write(struct file *file, const char __user *data,
172 return len; 174 return len;
173} 175}
174 176
175static int mv64x60_wdt_ioctl(struct inode *inode, struct file *file, 177static long mv64x60_wdt_ioctl(struct file *file,
176 unsigned int cmd, unsigned long arg) 178 unsigned int cmd, unsigned long arg)
177{ 179{
178 int timeout; 180 int timeout;
179 int options; 181 int options;
@@ -240,7 +242,7 @@ static const struct file_operations mv64x60_wdt_fops = {
240 .owner = THIS_MODULE, 242 .owner = THIS_MODULE,
241 .llseek = no_llseek, 243 .llseek = no_llseek,
242 .write = mv64x60_wdt_write, 244 .write = mv64x60_wdt_write,
243 .ioctl = mv64x60_wdt_ioctl, 245 .unlocked_ioctl = mv64x60_wdt_ioctl,
244 .open = mv64x60_wdt_open, 246 .open = mv64x60_wdt_open,
245 .release = mv64x60_wdt_release, 247 .release = mv64x60_wdt_release,
246}; 248};