diff options
Diffstat (limited to 'drivers/char/dsp56k.c')
-rw-r--r-- | drivers/char/dsp56k.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/char/dsp56k.c b/drivers/char/dsp56k.c index d716c78f0ff4..b9a30c30e2b8 100644 --- a/drivers/char/dsp56k.c +++ b/drivers/char/dsp56k.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/mm.h> | 33 | #include <linux/mm.h> |
34 | #include <linux/init.h> | 34 | #include <linux/init.h> |
35 | #include <linux/device.h> | 35 | #include <linux/device.h> |
36 | #include <linux/smp_lock.h> | ||
36 | #include <linux/firmware.h> | 37 | #include <linux/firmware.h> |
37 | #include <linux/platform_device.h> | 38 | #include <linux/platform_device.h> |
38 | 39 | ||
@@ -417,13 +418,17 @@ static unsigned int dsp56k_poll(struct file *file, poll_table *wait) | |||
417 | static int dsp56k_open(struct inode *inode, struct file *file) | 418 | static int dsp56k_open(struct inode *inode, struct file *file) |
418 | { | 419 | { |
419 | int dev = iminor(inode) & 0x0f; | 420 | int dev = iminor(inode) & 0x0f; |
421 | int ret = 0; | ||
420 | 422 | ||
423 | lock_kernel(); | ||
421 | switch(dev) | 424 | switch(dev) |
422 | { | 425 | { |
423 | case DSP56K_DEV_56001: | 426 | case DSP56K_DEV_56001: |
424 | 427 | ||
425 | if (test_and_set_bit(0, &dsp56k.in_use)) | 428 | if (test_and_set_bit(0, &dsp56k.in_use)) { |
426 | return -EBUSY; | 429 | ret = -EBUSY; |
430 | goto out; | ||
431 | } | ||
427 | 432 | ||
428 | dsp56k.timeout = TIMEOUT; | 433 | dsp56k.timeout = TIMEOUT; |
429 | dsp56k.maxio = MAXIO; | 434 | dsp56k.maxio = MAXIO; |
@@ -439,10 +444,11 @@ static int dsp56k_open(struct inode *inode, struct file *file) | |||
439 | break; | 444 | break; |
440 | 445 | ||
441 | default: | 446 | default: |
442 | return -ENODEV; | 447 | ret = -ENODEV; |
443 | } | 448 | } |
444 | 449 | out: | |
445 | return 0; | 450 | unlock_kernel(); |
451 | return ret; | ||
446 | } | 452 | } |
447 | 453 | ||
448 | static int dsp56k_release(struct inode *inode, struct file *file) | 454 | static int dsp56k_release(struct inode *inode, struct file *file) |