aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/sbus/char
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2008-05-20 13:16:08 -0400
committerJonathan Corbet <corbet@lwn.net>2008-06-20 16:05:58 -0400
commit28fbbf491368c9491461ca492e13862da1b49180 (patch)
treee0c64fab37a1374785ce1a7764e8f5836ca4fe3d /drivers/sbus/char
parentcddf63d99d0d145f18b293c3d0de4af7dab2a922 (diff)
jsflash: BKL pushdown
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/sbus/char')
-rw-r--r--drivers/sbus/char/jsflash.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/sbus/char/jsflash.c b/drivers/sbus/char/jsflash.c
index 4b7079fdc10c..2bec9ccc0293 100644
--- a/drivers/sbus/char/jsflash.c
+++ b/drivers/sbus/char/jsflash.c
@@ -27,6 +27,7 @@
27 */ 27 */
28 28
29#include <linux/module.h> 29#include <linux/module.h>
30#include <linux/smp_lock.h>
30#include <linux/types.h> 31#include <linux/types.h>
31#include <linux/errno.h> 32#include <linux/errno.h>
32#include <linux/miscdevice.h> 33#include <linux/miscdevice.h>
@@ -417,11 +418,17 @@ static int jsf_mmap(struct file * file, struct vm_area_struct * vma)
417 418
418static int jsf_open(struct inode * inode, struct file * filp) 419static int jsf_open(struct inode * inode, struct file * filp)
419{ 420{
420 421 lock_kernel();
421 if (jsf0.base == 0) return -ENXIO; 422 if (jsf0.base == 0) {
422 if (test_and_set_bit(0, (void *)&jsf0.busy) != 0) 423 unlock_kernel();
424 return -ENXIO;
425 }
426 if (test_and_set_bit(0, (void *)&jsf0.busy) != 0) {
427 unlock_kernel();
423 return -EBUSY; 428 return -EBUSY;
429 }
424 430
431 unlock_kernel();
425 return 0; /* XXX What security? */ 432 return 0; /* XXX What security? */
426} 433}
427 434