diff options
Diffstat (limited to 'drivers/watchdog/riowd.c')
-rw-r--r-- | drivers/watchdog/riowd.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/watchdog/riowd.c b/drivers/watchdog/riowd.c index d3c824dc2358..ea7f803f6248 100644 --- a/drivers/watchdog/riowd.c +++ b/drivers/watchdog/riowd.c | |||
@@ -10,12 +10,12 @@ | |||
10 | #include <linux/errno.h> | 10 | #include <linux/errno.h> |
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/miscdevice.h> | 12 | #include <linux/miscdevice.h> |
13 | #include <linux/smp_lock.h> | ||
14 | #include <linux/watchdog.h> | 13 | #include <linux/watchdog.h> |
15 | #include <linux/of.h> | 14 | #include <linux/of.h> |
16 | #include <linux/of_device.h> | 15 | #include <linux/of_device.h> |
17 | #include <linux/io.h> | 16 | #include <linux/io.h> |
18 | #include <linux/uaccess.h> | 17 | #include <linux/uaccess.h> |
18 | #include <linux/slab.h> | ||
19 | 19 | ||
20 | 20 | ||
21 | /* RIO uses the NatSemi Super I/O power management logical device | 21 | /* RIO uses the NatSemi Super I/O power management logical device |
@@ -75,7 +75,6 @@ static void riowd_writereg(struct riowd *p, u8 val, int index) | |||
75 | 75 | ||
76 | static int riowd_open(struct inode *inode, struct file *filp) | 76 | static int riowd_open(struct inode *inode, struct file *filp) |
77 | { | 77 | { |
78 | cycle_kernel_lock(); | ||
79 | nonseekable_open(inode, filp); | 78 | nonseekable_open(inode, filp); |
80 | return 0; | 79 | return 0; |
81 | } | 80 | } |
@@ -87,7 +86,7 @@ static int riowd_release(struct inode *inode, struct file *filp) | |||
87 | 86 | ||
88 | static long riowd_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | 87 | static long riowd_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
89 | { | 88 | { |
90 | static struct watchdog_info info = { | 89 | static const struct watchdog_info info = { |
91 | .options = WDIOF_SETTIMEOUT, | 90 | .options = WDIOF_SETTIMEOUT, |
92 | .firmware_version = 1, | 91 | .firmware_version = 1, |
93 | .identity = DRIVER_NAME, | 92 | .identity = DRIVER_NAME, |
@@ -194,6 +193,8 @@ static int __devinit riowd_probe(struct of_device *op, | |||
194 | printk(KERN_ERR PFX "Cannot map registers.\n"); | 193 | printk(KERN_ERR PFX "Cannot map registers.\n"); |
195 | goto out_free; | 194 | goto out_free; |
196 | } | 195 | } |
196 | /* Make miscdev useable right away */ | ||
197 | riowd_device = p; | ||
197 | 198 | ||
198 | err = misc_register(&riowd_miscdev); | 199 | err = misc_register(&riowd_miscdev); |
199 | if (err) { | 200 | if (err) { |
@@ -205,10 +206,10 @@ static int __devinit riowd_probe(struct of_device *op, | |||
205 | "regs at %p\n", riowd_timeout, p->regs); | 206 | "regs at %p\n", riowd_timeout, p->regs); |
206 | 207 | ||
207 | dev_set_drvdata(&op->dev, p); | 208 | dev_set_drvdata(&op->dev, p); |
208 | riowd_device = p; | ||
209 | return 0; | 209 | return 0; |
210 | 210 | ||
211 | out_iounmap: | 211 | out_iounmap: |
212 | riowd_device = NULL; | ||
212 | of_iounmap(&op->resource[0], p->regs, 2); | 213 | of_iounmap(&op->resource[0], p->regs, 2); |
213 | 214 | ||
214 | out_free: | 215 | out_free: |