Skip to content

Commit

Permalink
hpet: BKL pushdown
Browse files Browse the repository at this point in the history
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
  • Loading branch information
arndb authored and Jonathan Corbet committed Jun 20, 2008
1 parent 986f8b8 commit 48b8188
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/char/hpet.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/smp_lock.h>
#include <linux/types.h>
#include <linux/miscdevice.h>
#include <linux/major.h>
Expand Down Expand Up @@ -193,6 +194,7 @@ static int hpet_open(struct inode *inode, struct file *file)
if (file->f_mode & FMODE_WRITE)
return -EINVAL;

lock_kernel();
spin_lock_irq(&hpet_lock);

for (devp = NULL, hpetp = hpets; hpetp && !devp; hpetp = hpetp->hp_next)
Expand All @@ -207,13 +209,15 @@ static int hpet_open(struct inode *inode, struct file *file)

if (!devp) {
spin_unlock_irq(&hpet_lock);
unlock_kernel();
return -EBUSY;
}

file->private_data = devp;
devp->hd_irqdata = 0;
devp->hd_flags |= HPET_OPEN;
spin_unlock_irq(&hpet_lock);
unlock_kernel();

return 0;
}
Expand Down

0 comments on commit 48b8188

Please sign in to comment.