V4L/DVB: lirc: use unlocked_ioctl

New code should not rely on the big kernel lock,
so use the unlocked_ioctl file operation in lirc.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Jarod Wilson <jarod@redhat.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
diff --git a/drivers/media/IR/lirc_dev.c b/drivers/media/IR/lirc_dev.c
index 64170fa..c11b8f7 100644
--- a/drivers/media/IR/lirc_dev.c
+++ b/drivers/media/IR/lirc_dev.c
@@ -160,7 +160,7 @@
 	.read		= lirc_dev_fop_read,
 	.write		= lirc_dev_fop_write,
 	.poll		= lirc_dev_fop_poll,
-	.ioctl		= lirc_dev_fop_ioctl,
+	.unlocked_ioctl	= lirc_dev_fop_ioctl,
 	.open		= lirc_dev_fop_open,
 	.release	= lirc_dev_fop_close,
 };
@@ -242,9 +242,9 @@
 		goto out;
 	} else if (!d->rbuf) {
 		if (!(d->fops && d->fops->read && d->fops->poll &&
-		      d->fops->ioctl)) {
+		      d->fops->unlocked_ioctl)) {
 			dev_err(d->dev, "lirc_dev: lirc_register_driver: "
-				"neither read, poll nor ioctl can be NULL!\n");
+				"neither read, poll nor unlocked_ioctl can be NULL!\n");
 			err = -EBADRQC;
 			goto out;
 		}
@@ -425,6 +425,7 @@
 		retval = -ENODEV;
 		goto error;
 	}
+	file->private_data = ir;
 
 	dev_dbg(ir->d.dev, LOGHEAD "open called\n", ir->d.name, ir->d.minor);
 
@@ -516,12 +517,11 @@
 }
 EXPORT_SYMBOL(lirc_dev_fop_poll);
 
-int lirc_dev_fop_ioctl(struct inode *inode, struct file *file,
-		       unsigned int cmd, unsigned long arg)
+long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
 	unsigned long mode;
 	int result = 0;
-	struct irctl *ir = irctls[iminor(inode)];
+	struct irctl *ir = file->private_data;
 
 	dev_dbg(ir->d.dev, LOGHEAD "ioctl called (0x%x)\n",
 		ir->d.name, ir->d.minor, cmd);