public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nwflash: Push down BKL
@ 2008-05-22 21:16 Alan Cox
  2008-07-08 20:10 ` Russell King
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Cox @ 2008-05-22 21:16 UTC (permalink / raw)
  To: linux-kernel, rmk

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 =

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-07-08 20:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-22 21:16 [PATCH] nwflash: Push down BKL Alan Cox
2008-07-08 20:10 ` Russell King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox