Commit 48b81880 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Jonathan Corbet

hpet: BKL pushdown

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 986f8b8c
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/smp_lock.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/major.h> #include <linux/major.h>
...@@ -193,6 +194,7 @@ static int hpet_open(struct inode *inode, struct file *file) ...@@ -193,6 +194,7 @@ static int hpet_open(struct inode *inode, struct file *file)
if (file->f_mode & FMODE_WRITE) if (file->f_mode & FMODE_WRITE)
return -EINVAL; return -EINVAL;
lock_kernel();
spin_lock_irq(&hpet_lock); spin_lock_irq(&hpet_lock);
for (devp = NULL, hpetp = hpets; hpetp && !devp; hpetp = hpetp->hp_next) 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,6 +209,7 @@ static int hpet_open(struct inode *inode, struct file *file)
if (!devp) { if (!devp) {
spin_unlock_irq(&hpet_lock); spin_unlock_irq(&hpet_lock);
unlock_kernel();
return -EBUSY; return -EBUSY;
} }
...@@ -214,6 +217,7 @@ static int hpet_open(struct inode *inode, struct file *file) ...@@ -214,6 +217,7 @@ static int hpet_open(struct inode *inode, struct file *file)
devp->hd_irqdata = 0; devp->hd_irqdata = 0;
devp->hd_flags |= HPET_OPEN; devp->hd_flags |= HPET_OPEN;
spin_unlock_irq(&hpet_lock); spin_unlock_irq(&hpet_lock);
unlock_kernel();
return 0; return 0;
} }
......
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