]> Pileus Git - ~andy/linux/blobdiff - drivers/char/hpet.c
Merge branch 'linus' into timers/hpet
[~andy/linux] / drivers / char / hpet.c
index c9bf5d44402d2f5f2d336e056a63f2323e337575..f3981ffe20f0ee307bfe7b0197cc6397d40a3652 100644 (file)
@@ -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>
@@ -254,6 +255,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)
@@ -268,6 +270,7 @@ static int hpet_open(struct inode *inode, struct file *file)
 
        if (!devp) {
                spin_unlock_irq(&hpet_lock);
+               unlock_kernel();
                return -EBUSY;
        }
 
@@ -275,6 +278,7 @@ static int hpet_open(struct inode *inode, struct file *file)
        devp->hd_irqdata = 0;
        devp->hd_flags |= HPET_OPEN;
        spin_unlock_irq(&hpet_lock);
+       unlock_kernel();
 
        hpet_timer_set_irq(devp);
 
@@ -682,6 +686,7 @@ static inline int hpet_tpcheck(struct hpet_task *tp)
        return -ENXIO;
 }
 
+#if 0
 int hpet_unregister(struct hpet_task *tp)
 {
        struct hpet_dev *devp;
@@ -711,6 +716,7 @@ int hpet_unregister(struct hpet_task *tp)
 
        return 0;
 }
+#endif  /*  0  */
 
 static ctl_table hpet_table[] = {
        {