aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/dsp56k.c
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2008-05-16 15:57:31 -0400
committerJonathan Corbet <corbet@lwn.net>2008-06-20 16:05:51 -0400
commit65f37b790bd7ba15413838579470296a709c45e6 (patch)
treef6ce51d05304810cc96bc1820fadf371da5b9d8b /drivers/char/dsp56k.c
parentc0bed680f0ca603864375ed5f9fed4296a53aa62 (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>
Diffstat (limited to 'drivers/char/dsp56k.c')
-rw-r--r--drivers/char/dsp56k.c16
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)
436static int dsp56k_open(struct inode *inode, struct file *file) 437static 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 468out:
464 return 0; 469 unlock_kernel();
470 return ret;
465} 471}
466 472
467static int dsp56k_release(struct inode *inode, struct file *file) 473static int dsp56k_release(struct inode *inode, struct file *file)