Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 100307
b: refs/heads/master
c: 65f37b7
h: refs/heads/master
i:
  100305: f24dfbc
  100303: 86a848d
v: v3
  • Loading branch information
Jonathan Corbet committed Jun 20, 2008
1 parent f6d1830 commit c815a4a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c0bed680f0ca603864375ed5f9fed4296a53aa62
refs/heads/master: 65f37b790bd7ba15413838579470296a709c45e6
16 changes: 11 additions & 5 deletions trunk/drivers/char/dsp56k.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <linux/mm.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/smp_lock.h>

#include <asm/atarihw.h>
#include <asm/traps.h>
Expand Down Expand Up @@ -436,13 +437,17 @@ static unsigned int dsp56k_poll(struct file *file, poll_table *wait)
static int dsp56k_open(struct inode *inode, struct file *file)
{
int dev = iminor(inode) & 0x0f;
int ret = 0;

lock_kernel();
switch(dev)
{
case DSP56K_DEV_56001:

if (test_and_set_bit(0, &dsp56k.in_use))
return -EBUSY;
if (test_and_set_bit(0, &dsp56k.in_use)) {
ret = -EBUSY;
goto out;
}

dsp56k.timeout = TIMEOUT;
dsp56k.maxio = MAXIO;
Expand All @@ -458,10 +463,11 @@ static int dsp56k_open(struct inode *inode, struct file *file)
break;

default:
return -ENODEV;
ret = -ENODEV;
}

return 0;
out:
unlock_kernel();
return ret;
}

static int dsp56k_release(struct inode *inode, struct file *file)
Expand Down

0 comments on commit c815a4a

Please sign in to comment.