git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'for-2.6.27' of git://git.infradead.org/users/dwmw2/firmware-2.6
[pandora-kernel.git]
/
drivers
/
char
/
dsp56k.c
diff --git
a/drivers/char/dsp56k.c
b/drivers/char/dsp56k.c
index
d716c78
..
b9a30c3
100644
(file)
--- a/
drivers/char/dsp56k.c
+++ b/
drivers/char/dsp56k.c
@@
-33,6
+33,7
@@
#include <linux/mm.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/mm.h>
#include <linux/init.h>
#include <linux/device.h>
+#include <linux/smp_lock.h>
#include <linux/firmware.h>
#include <linux/platform_device.h>
#include <linux/firmware.h>
#include <linux/platform_device.h>
@@
-417,13
+418,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;
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:
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;
dsp56k.timeout = TIMEOUT;
dsp56k.maxio = MAXIO;
@@
-439,10
+444,11
@@
static int dsp56k_open(struct inode *inode, struct file *file)
break;
default:
break;
default:
- ret
urn
-ENODEV;
+ ret
=
-ENODEV;
}
}
-
- return 0;
+out:
+ unlock_kernel();
+ return ret;
}
static int dsp56k_release(struct inode *inode, struct file *file)
}
static int dsp56k_release(struct inode *inode, struct file *file)