X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fsbus%2Fchar%2Fflash.c;h=7d95e151513a0a5446e07ef6da24d9605334af53;hb=666484f0250db2e016948d63b3ef33e202e3b8d0;hp=fa2418f7ad393c78af158a4540fa80cf6213d297;hpb=ca78f6baca863afe2e6a244a0fe94b3a70211d46;p=linux-2.6 diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c index fa2418f7ad..7d95e15151 100644 --- a/drivers/sbus/char/flash.c +++ b/drivers/sbus/char/flash.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -126,9 +127,13 @@ flash_read(struct file * file, char __user * buf, static int flash_open(struct inode *inode, struct file *file) { - if (test_and_set_bit(0, (void *)&flash.busy) != 0) + lock_kernel(); + if (test_and_set_bit(0, (void *)&flash.busy) != 0) { + unlock_kernel(); return -EBUSY; + } + unlock_kernel(); return 0; } @@ -142,7 +147,7 @@ flash_release(struct inode *inode, struct file *file) return 0; } -static struct file_operations flash_fops = { +static const struct file_operations flash_fops = { /* no write to the Flash, use mmap * and play flash dependent tricks. */ @@ -190,7 +195,7 @@ static int __init flash_init(void) } if (!sdev) { #ifdef CONFIG_PCI - struct linux_prom_registers *ebus_regs; + const struct linux_prom_registers *ebus_regs; for_each_ebus(ebus) { for_each_ebusdev(edev, ebus) {