aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/sbus/char/flash.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-07-15 01:44:51 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-07-15 01:44:51 -0400
commit43d2548bb2ef7e6d753f91468a746784041e522d (patch)
tree77d13fcd48fd998393abb825ec36e2b732684a73 /drivers/sbus/char/flash.c
parent585583d95c5660973bc0cf64add517b040acd8a4 (diff)
parent85082fd7cbe3173198aac0eb5e85ab1edcc6352c (diff)
Merge commit '85082fd7cbe3173198aac0eb5e85ab1edcc6352c' into test-build
Manual fixup of: arch/powerpc/Kconfig
Diffstat (limited to 'drivers/sbus/char/flash.c')
-rw-r--r--drivers/sbus/char/flash.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c
index 44e039865aa9..7d95e151513a 100644
--- a/drivers/sbus/char/flash.c
+++ b/drivers/sbus/char/flash.c
@@ -127,9 +127,13 @@ flash_read(struct file * file, char __user * buf,
127static int 127static int
128flash_open(struct inode *inode, struct file *file) 128flash_open(struct inode *inode, struct file *file)
129{ 129{
130 if (test_and_set_bit(0, (void *)&flash.busy) != 0) 130 lock_kernel();
131 if (test_and_set_bit(0, (void *)&flash.busy) != 0) {
132 unlock_kernel();
131 return -EBUSY; 133 return -EBUSY;
134 }
132 135
136 unlock_kernel();
133 return 0; 137 return 0;
134} 138}
135 139