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, dwmw2@redhat.com
Subject: [PATCH] applicom: push BKL down into driver
Date: Thu, 22 May 2008 21:24:49 +0100	[thread overview]
Message-ID: <20080522212449.0ad5f598@core> (raw)

Not a lot of elimination here just push it down so someone can do it
later.

Signed-off-by: Alan Cox <alan@redhat.com>

diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
index 31d08b6..80fed25 100644
--- a/drivers/char/applicom.c
+++ b/drivers/char/applicom.c
@@ -104,8 +104,7 @@ static unsigned int DeviceErrorCount;	/* number of device error     */
 
 static ssize_t ac_read (struct file *, char __user *, size_t, loff_t *);
 static ssize_t ac_write (struct file *, const char __user *, size_t, loff_t *);
-static int ac_ioctl(struct inode *, struct file *, unsigned int,
-		    unsigned long);
+static long ac_ioctl(struct file *, unsigned int, unsigned long);
 static irqreturn_t ac_interrupt(int, void *);
 
 static const struct file_operations ac_fops = {
@@ -113,7 +112,7 @@ static const struct file_operations ac_fops = {
 	.llseek = no_llseek,
 	.read = ac_read,
 	.write = ac_write,
-	.ioctl = ac_ioctl,
+	.unlocked_ioctl = ac_ioctl,
 };
 
 static struct miscdevice ac_miscdev = {
@@ -687,7 +686,7 @@ static irqreturn_t ac_interrupt(int vec, void *dev_instance)
 
 
 
-static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
+static long ac_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
      
 {				/* @ ADG ou ATO selon le cas */
 	int i;
@@ -710,6 +709,8 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 		return -EFAULT;
 	}
 	
+	lock_kernel();
+
 	IndexCard = adgl->num_card-1;
 	 
 	if(cmd != 0 && cmd != 6 &&
@@ -720,6 +721,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 			warncount--;
 		}
 		kfree(adgl);
+		unlock_kernel();
 		return -EINVAL;
 	}
 
@@ -837,6 +839,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 		break;
 	}
 	Dummy = readb(apbs[IndexCard].RamIO + VERS);
+	unlock_kernel();
 	kfree(adgl);
 	return 0;
 }

                 reply	other threads:[~2008-05-22 20:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20080522212449.0ad5f598@core \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=dwmw2@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /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