public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: linux-kernel@vger.kernel.org, rmk@arm.linux.org.uk
Subject: [PATCH] nwflash: Push down BKL
Date: Thu, 22 May 2008 22:16:10 +0100	[thread overview]
Message-ID: <20080522221610.5b339e0d@core> (raw)

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 =

             reply	other threads:[~2008-05-22 21:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-22 21:16 Alan Cox [this message]
2008-07-08 20:10 ` [PATCH] nwflash: Push down BKL Russell King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080522221610.5b339e0d@core \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox