Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 100350
b: refs/heads/master
c: 48b8188
h: refs/heads/master
v: v3
  • Loading branch information
Arnd Bergmann authored and Jonathan Corbet committed Jun 20, 2008
1 parent 0def8c4 commit 30b7721
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 986f8b8ccf4806c1e95528a6f157998113fb4f41
refs/heads/master: 48b81880519274d2a8b3e9919a47d91d05a1c964
4 changes: 4 additions & 0 deletions trunk/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 30b7721

Please sign in to comment.