diff options
author | Jonathan Corbet <corbet@lwn.net> | 2008-05-16 15:57:31 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2008-06-20 16:05:51 -0400 |
commit | 65f37b790bd7ba15413838579470296a709c45e6 (patch) | |
tree | f6ce51d05304810cc96bc1820fadf371da5b9d8b | |
parent | c0bed680f0ca603864375ed5f9fed4296a53aa62 (diff) |
dsp56k: BKL pushdown
Put explicit lock_kernel calls into dsp56k_open().
[Stupid missing label error fixed]
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
-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 a69c65283260..7bf7485377e6 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 | 37 | ||
37 | #include <asm/atarihw.h> | 38 | #include <asm/atarihw.h> |
38 | #include <asm/traps.h> | 39 | #include <asm/traps.h> |
@@ -436,13 +437,17 @@ static unsigned int dsp56k_poll(struct file *file, poll_table *wait) | |||
436 | static int dsp56k_open(struct inode *inode, struct file *file) | 437 | static int dsp56k_open(struct inode *inode, struct file *file) |
437 | { | 438 | { |
438 | int dev = iminor(inode) & 0x0f; | 439 | int dev = iminor(inode) & 0x0f; |
440 | int ret = 0; | ||
439 | 441 | ||
442 | lock_kernel(); | ||
440 | switch(dev) | 443 | switch(dev) |
441 | { | 444 | { |
442 | case DSP56K_DEV_56001: | 445 | case DSP56K_DEV_56001: |
443 | 446 | ||
444 | if (test_and_set_bit(0, &dsp56k.in_use)) | 447 | if (test_and_set_bit(0, &dsp56k.in_use)) { |
445 | return -EBUSY; | 448 | ret = -EBUSY; |
449 | goto out; | ||
450 | } | ||
446 | 451 | ||
447 | dsp56k.timeout = TIMEOUT; | 452 | dsp56k.timeout = TIMEOUT; |
448 | dsp56k.maxio = MAXIO; | 453 | dsp56k.maxio = MAXIO; |
@@ -458,10 +463,11 @@ static int dsp56k_open(struct inode *inode, struct file *file) | |||
458 | break; | 463 | break; |
459 | 464 | ||
460 | default: | 465 | default: |
461 | return -ENODEV; | 466 | ret = -ENODEV; |
462 | } | 467 | } |
463 | 468 | out: | |
464 | return 0; | 469 | unlock_kernel(); |
470 | return ret; | ||
465 | } | 471 | } |
466 | 472 | ||
467 | static int dsp56k_release(struct inode *inode, struct file *file) | 473 | static int dsp56k_release(struct inode *inode, struct file *file) |