aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/mpc83xx_wdt.c
diff options
context:
space:
mode:
authorAlan Cox <alan@redhat.com>2008-05-19 09:07:09 -0400
committerWim Van Sebroeck <wim@iguana.be>2008-06-13 15:44:39 -0400
commitf26ef3dc69467e135e2b9555e44a088aee5c7d8f (patch)
tree629c9d74f539875d5f18e8d0536199dfd7a25ebc /drivers/watchdog/mpc83xx_wdt.c
parent3930964532f8e454910cbe0d9909e98a02d9f552 (diff)
[WATCHDOG 26/57] mpc watchdog: clean up and locking
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/mpc83xx_wdt.c')
-rw-r--r--drivers/watchdog/mpc83xx_wdt.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/watchdog/mpc83xx_wdt.c b/drivers/watchdog/mpc83xx_wdt.c
index b16c5cd972eb..109eea0df2d0 100644
--- a/drivers/watchdog/mpc83xx_wdt.c
+++ b/drivers/watchdog/mpc83xx_wdt.c
@@ -22,8 +22,8 @@
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/watchdog.h> 24#include <linux/watchdog.h>
25#include <asm/io.h> 25#include <linux/io.h>
26#include <asm/uaccess.h> 26#include <linux/uaccess.h>
27 27
28struct mpc83xx_wdt { 28struct mpc83xx_wdt {
29 __be32 res0; 29 __be32 res0;
@@ -42,11 +42,13 @@ static struct mpc83xx_wdt __iomem *wd_base;
42 42
43static u16 timeout = 0xffff; 43static u16 timeout = 0xffff;
44module_param(timeout, ushort, 0); 44module_param(timeout, ushort, 0);
45MODULE_PARM_DESC(timeout, "Watchdog timeout in ticks. (0<timeout<65536, default=65535"); 45MODULE_PARM_DESC(timeout,
46 "Watchdog timeout in ticks. (0<timeout<65536, default=65535");
46 47
47static int reset = 1; 48static int reset = 1;
48module_param(reset, bool, 0); 49module_param(reset, bool, 0);
49MODULE_PARM_DESC(reset, "Watchdog Interrupt/Reset Mode. 0 = interrupt, 1 = reset"); 50MODULE_PARM_DESC(reset,
51 "Watchdog Interrupt/Reset Mode. 0 = interrupt, 1 = reset");
50 52
51/* 53/*
52 * We always prescale, but if someone really doesn't want to they can set this 54 * We always prescale, but if someone really doesn't want to they can set this
@@ -105,8 +107,8 @@ static int mpc83xx_wdt_release(struct inode *inode, struct file *file)
105 return 0; 107 return 0;
106} 108}
107 109
108static int mpc83xx_wdt_ioctl(struct inode *inode, struct file *file, 110static long mpc83xx_wdt_ioctl(struct file *file, unsigned int cmd,
109 unsigned int cmd, unsigned long arg) 111 unsigned long arg)
110{ 112{
111 void __user *argp = (void __user *)arg; 113 void __user *argp = (void __user *)arg;
112 int __user *p = argp; 114 int __user *p = argp;
@@ -136,7 +138,7 @@ static const struct file_operations mpc83xx_wdt_fops = {
136 .owner = THIS_MODULE, 138 .owner = THIS_MODULE,
137 .llseek = no_llseek, 139 .llseek = no_llseek,
138 .write = mpc83xx_wdt_write, 140 .write = mpc83xx_wdt_write,
139 .ioctl = mpc83xx_wdt_ioctl, 141 .unlocked_ioctl = mpc83xx_wdt_ioctl,
140 .open = mpc83xx_wdt_open, 142 .open = mpc83xx_wdt_open,
141 .release = mpc83xx_wdt_release, 143 .release = mpc83xx_wdt_release,
142}; 144};
@@ -161,8 +163,7 @@ static int __devinit mpc83xx_wdt_probe(struct platform_device *dev)
161 goto err_out; 163 goto err_out;
162 } 164 }
163 165
164 wd_base = ioremap(r->start, sizeof (struct mpc83xx_wdt)); 166 wd_base = ioremap(r->start, sizeof(struct mpc83xx_wdt));
165
166 if (wd_base == NULL) { 167 if (wd_base == NULL) {
167 ret = -ENOMEM; 168 ret = -ENOMEM;
168 goto err_out; 169 goto err_out;