aboutsummaryrefslogtreecommitdiff
path: root/drivers/watchdog/riowd.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-11-02 21:16:28 -0800
committerDavid S. Miller <davem@davemloft.net>2009-11-02 21:16:28 -0800
commit462265bf494c4f2a2f6e06480590becadecbfea7 (patch)
treeab2a6a5232c2ed90bd93a350811ed7e4019ff8d8 /drivers/watchdog/riowd.c
parent49ab972aea7fca7b94f9df0f1f077fdab40a825d (diff)
watchdog: Remove BKL from rio watchdog driver
cycle_kernel_lock() was added with the BKL pushdown. The rio driver indeed needs that because riowd_device is initialized after misc_register(). So an open(), write/ioctl() which happens to get between misc_register returning and riowd_device initialization would dereference a NULL pointer. Move riowd_device initialization before misc_register() and get rid of cycle_kernel_lock(). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/watchdog/riowd.c')
-rw-r--r--drivers/watchdog/riowd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/watchdog/riowd.c b/drivers/watchdog/riowd.c
index d3c824dc235..c14ae867690 100644
--- a/drivers/watchdog/riowd.c
+++ b/drivers/watchdog/riowd.c
@@ -10,7 +10,6 @@
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/miscdevice.h>
-#include <linux/smp_lock.h>
#include <linux/watchdog.h>
#include <linux/of.h>
#include <linux/of_device.h>
@@ -75,7 +74,6 @@ static void riowd_writereg(struct riowd *p, u8 val, int index)
static int riowd_open(struct inode *inode, struct file *filp)
{
- cycle_kernel_lock();
nonseekable_open(inode, filp);
return 0;
}
@@ -194,6 +192,8 @@ static int __devinit riowd_probe(struct of_device *op,
printk(KERN_ERR PFX "Cannot map registers.\n");
goto out_free;
}
+ /* Make miscdev useable right away */
+ riowd_device = p;
err = misc_register(&riowd_miscdev);
if (err) {
@@ -205,10 +205,10 @@ static int __devinit riowd_probe(struct of_device *op,
"regs at %p\n", riowd_timeout, p->regs);
dev_set_drvdata(&op->dev, p);
- riowd_device = p;
return 0;
out_iounmap:
+ riowd_device = NULL;
of_iounmap(&op->resource[0], p->regs, 2);
out_free: