aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/hpet.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2008-05-20 13:15:59 -0400
committerJonathan Corbet <corbet@lwn.net>2008-06-20 16:05:57 -0400
commit48b81880519274d2a8b3e9919a47d91d05a1c964 (patch)
tree6da458b2ca35a393ccbda7ef7eed39fa5a37f1f2 /drivers/char/hpet.c
parent986f8b8ccf4806c1e95528a6f157998113fb4f41 (diff)
hpet: BKL pushdown
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/char/hpet.c')
-rw-r--r--drivers/char/hpet.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index e7fb0bca3667..fb0a85a1eb36 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -14,6 +14,7 @@
14#include <linux/interrupt.h> 14#include <linux/interrupt.h>
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/smp_lock.h>
17#include <linux/types.h> 18#include <linux/types.h>
18#include <linux/miscdevice.h> 19#include <linux/miscdevice.h>
19#include <linux/major.h> 20#include <linux/major.h>
@@ -193,6 +194,7 @@ static int hpet_open(struct inode *inode, struct file *file)
193 if (file->f_mode & FMODE_WRITE) 194 if (file->f_mode & FMODE_WRITE)
194 return -EINVAL; 195 return -EINVAL;
195 196
197 lock_kernel();
196 spin_lock_irq(&hpet_lock); 198 spin_lock_irq(&hpet_lock);
197 199
198 for (devp = NULL, hpetp = hpets; hpetp && !devp; hpetp = hpetp->hp_next) 200 for (devp = NULL, hpetp = hpets; hpetp && !devp; hpetp = hpetp->hp_next)
@@ -207,6 +209,7 @@ static int hpet_open(struct inode *inode, struct file *file)
207 209
208 if (!devp) { 210 if (!devp) {
209 spin_unlock_irq(&hpet_lock); 211 spin_unlock_irq(&hpet_lock);
212 unlock_kernel();
210 return -EBUSY; 213 return -EBUSY;
211 } 214 }
212 215
@@ -214,6 +217,7 @@ static int hpet_open(struct inode *inode, struct file *file)
214 devp->hd_irqdata = 0; 217 devp->hd_irqdata = 0;
215 devp->hd_flags |= HPET_OPEN; 218 devp->hd_flags |= HPET_OPEN;
216 spin_unlock_irq(&hpet_lock); 219 spin_unlock_irq(&hpet_lock);
220 unlock_kernel();
217 221
218 return 0; 222 return 0;
219} 223}