Commit b8c71d7a authored by Jonathan Corbet's avatar Jonathan Corbet

tlckl: BKL pushdown

Put explicit lock_kernel calls into tlclk_open()
Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent f4943db1
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/smp_lock.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/sysfs.h> #include <linux/sysfs.h>
#include <linux/device.h> #include <linux/device.h>
...@@ -204,11 +205,14 @@ static int tlclk_open(struct inode *inode, struct file *filp) ...@@ -204,11 +205,14 @@ static int tlclk_open(struct inode *inode, struct file *filp)
{ {
int result; int result;
if (test_and_set_bit(0, &useflags)) lock_kernel();
return -EBUSY; if (test_and_set_bit(0, &useflags)) {
result = -EBUSY;
/* this legacy device is always one per system and it doesn't /* this legacy device is always one per system and it doesn't
* know how to handle multiple concurrent clients. * know how to handle multiple concurrent clients.
*/ */
goto out;
}
/* Make sure there is no interrupt pending while /* Make sure there is no interrupt pending while
* initialising interrupt handler */ * initialising interrupt handler */
...@@ -218,13 +222,14 @@ static int tlclk_open(struct inode *inode, struct file *filp) ...@@ -218,13 +222,14 @@ static int tlclk_open(struct inode *inode, struct file *filp)
* we can't share this IRQ */ * we can't share this IRQ */
result = request_irq(telclk_interrupt, &tlclk_interrupt, result = request_irq(telclk_interrupt, &tlclk_interrupt,
IRQF_DISABLED, "telco_clock", tlclk_interrupt); IRQF_DISABLED, "telco_clock", tlclk_interrupt);
if (result == -EBUSY) { if (result == -EBUSY)
printk(KERN_ERR "tlclk: Interrupt can't be reserved.\n"); printk(KERN_ERR "tlclk: Interrupt can't be reserved.\n");
return -EBUSY; else
}
inb(TLCLK_REG6); /* Clear interrupt events */ inb(TLCLK_REG6); /* Clear interrupt events */
return 0; out:
unlock_kernel();
return result;
} }
static int tlclk_release(struct inode *inode, struct file *filp) static int tlclk_release(struct inode *inode, struct file *filp)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment