diff --git a/drivers/watchdog/riowd.c b/drivers/watchdog/riowd.c index d3c824dc2358..c14ae8676903 100644 --- a/drivers/watchdog/riowd.c +++ b/drivers/watchdog/riowd.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -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: