Push the BKL down into the driver ready for the BKL ioctl removal
Signed-off-by: Alan Cox <alan@redhat.com>
diff --git a/drivers/char/nwflash.c b/drivers/char/nwflash.c
index ba012c2..02d882b 100644
--- a/drivers/char/nwflash.c
+++ b/drivers/char/nwflash.c
@@ -95,8 +95,11 @@ static int get_flash_id(void)
return c2;
}
-static int flash_ioctl(struct inode *inodep, struct file *filep, unsigned int cmd, unsigned long arg)
+static long flash_ioctl(struct file *filep, unsigned int cmd,
+ unsigned long arg)
{
+ long ret = 0;
+ lock_kernel();
switch (cmd) {
case CMD_WRITE_DISABLE:
gbWriteBase64Enable = 0;
@@ -114,9 +117,10 @@ static int flash_ioctl(struct inode *inodep, struct file *filep, unsigned int cm
default:
gbWriteBase64Enable = 0;
gbWriteEnable = 0;
- return -EINVAL;
+ ret = -ENOTTY;
}
- return 0;
+ unlock_kernel();
+ return ret;
}
static ssize_t flash_read(struct file *file, char __user *buf, size_t size,
@@ -647,7 +651,7 @@ static const struct file_operations flash_fops =
.llseek = flash_llseek,
.read = flash_read,
.write = flash_write,
- .ioctl = flash_ioctl,
+ .unlocked_ioctl = flash_ioctl,
};
static struct miscdevice flash_miscdev =
--
| Alan Cox | [PATCH 00/76] Queued TTY Patches |
| Nick Piggin | [patch 1/6] mm: debug check for the fault vs invalidate race |
| Andi Kleen | [PATCH] [1/22] x86_64: dma_ops as const |
| Linus Torvalds | Linux 2.6.27-rc8 |
git: | |
| Jeff King | Re: What's cooking in git/spearce.git (topics) |
| Jeff King | Re: [RFC] origin link for cherry-pick and revert |
| Matt Seitz (matseitz) | Symbolic link documentation |
| Jon Smirl | Huge win, compressing a window of delta runs as a unit |
| Richard Stallman | Real men don't attack straw men |
| Leon Dippenaar | New tcp stack attack |
| Nuno Magalhães | Can't scp, ssh is slow to authenticate. |
| Brandon Lee | DELL PERC 5iR slow performance |
| KOSAKI Motohiro | [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
| Denys Vlasenko | Re: bnx2 dirver's firmware images |
| Pavel Emelyanov | [PATCH 0/8] Cleanup/fix the sk_alloc() call |
| Kok, Auke | Re: [PATCH] drivers/net: remove network drivers' last few uses of IRQF_SAMPLE_RANDOM |
