aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2010-08-02 14:43:35 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-08-02 15:42:22 -0400
commit044e5878c2158d701e6f47a9604910589a384ee2 (patch)
tree9d06e2660ad15575a5df2c1e3bacfa68738ea55e
parentf9839da0513b4f13a137a07a9362ea5b02897bd7 (diff)
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>
-rw-r--r--drivers/media/IR/ir-lirc-codec.c7
-rw-r--r--drivers/media/IR/lirc_dev.c12
-rw-r--r--drivers/media/IR/lirc_dev.h3
3 files changed, 10 insertions, 12 deletions
diff --git a/drivers/media/IR/ir-lirc-codec.c b/drivers/media/IR/ir-lirc-codec.c
index aff31d1b13d..178bc5baab7 100644
--- a/drivers/media/IR/ir-lirc-codec.c
+++ b/drivers/media/IR/ir-lirc-codec.c
@@ -97,8 +97,7 @@ out:
97 return ret; 97 return ret;
98} 98}
99 99
100static int ir_lirc_ioctl(struct inode *node, struct file *filep, 100static long ir_lirc_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
101 unsigned int cmd, unsigned long arg)
102{ 101{
103 struct lirc_codec *lirc; 102 struct lirc_codec *lirc;
104 struct ir_input_dev *ir_dev; 103 struct ir_input_dev *ir_dev;
@@ -154,7 +153,7 @@ static int ir_lirc_ioctl(struct inode *node, struct file *filep,
154 break; 153 break;
155 154
156 default: 155 default:
157 return lirc_dev_fop_ioctl(node, filep, cmd, arg); 156 return lirc_dev_fop_ioctl(filep, cmd, arg);
158 } 157 }
159 158
160 return ret; 159 return ret;
@@ -173,7 +172,7 @@ static void ir_lirc_close(void *data)
173static struct file_operations lirc_fops = { 172static struct file_operations lirc_fops = {
174 .owner = THIS_MODULE, 173 .owner = THIS_MODULE,
175 .write = ir_lirc_transmit_ir, 174 .write = ir_lirc_transmit_ir,
176 .ioctl = ir_lirc_ioctl, 175 .unlocked_ioctl = ir_lirc_ioctl,
177 .read = lirc_dev_fop_read, 176 .read = lirc_dev_fop_read,
178 .poll = lirc_dev_fop_poll, 177 .poll = lirc_dev_fop_poll,
179 .open = lirc_dev_fop_open, 178 .open = lirc_dev_fop_open,
diff --git a/drivers/media/IR/lirc_dev.c b/drivers/media/IR/lirc_dev.c
index 64170fa5800..c11b8f70625 100644
--- a/drivers/media/IR/lirc_dev.c
+++ b/drivers/media/IR/lirc_dev.c
@@ -160,7 +160,7 @@ static struct file_operations fops = {
160 .read = lirc_dev_fop_read, 160 .read = lirc_dev_fop_read,
161 .write = lirc_dev_fop_write, 161 .write = lirc_dev_fop_write,
162 .poll = lirc_dev_fop_poll, 162 .poll = lirc_dev_fop_poll,
163 .ioctl = lirc_dev_fop_ioctl, 163 .unlocked_ioctl = lirc_dev_fop_ioctl,
164 .open = lirc_dev_fop_open, 164 .open = lirc_dev_fop_open,
165 .release = lirc_dev_fop_close, 165 .release = lirc_dev_fop_close,
166}; 166};
@@ -242,9 +242,9 @@ int lirc_register_driver(struct lirc_driver *d)
242 goto out; 242 goto out;
243 } else if (!d->rbuf) { 243 } else if (!d->rbuf) {
244 if (!(d->fops && d->fops->read && d->fops->poll && 244 if (!(d->fops && d->fops->read && d->fops->poll &&
245 d->fops->ioctl)) { 245 d->fops->unlocked_ioctl)) {
246 dev_err(d->dev, "lirc_dev: lirc_register_driver: " 246 dev_err(d->dev, "lirc_dev: lirc_register_driver: "
247 "neither read, poll nor ioctl can be NULL!\n"); 247 "neither read, poll nor unlocked_ioctl can be NULL!\n");
248 err = -EBADRQC; 248 err = -EBADRQC;
249 goto out; 249 goto out;
250 } 250 }
@@ -425,6 +425,7 @@ int lirc_dev_fop_open(struct inode *inode, struct file *file)
425 retval = -ENODEV; 425 retval = -ENODEV;
426 goto error; 426 goto error;
427 } 427 }
428 file->private_data = ir;
428 429
429 dev_dbg(ir->d.dev, LOGHEAD "open called\n", ir->d.name, ir->d.minor); 430 dev_dbg(ir->d.dev, LOGHEAD "open called\n", ir->d.name, ir->d.minor);
430 431
@@ -516,12 +517,11 @@ unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait)
516} 517}
517EXPORT_SYMBOL(lirc_dev_fop_poll); 518EXPORT_SYMBOL(lirc_dev_fop_poll);
518 519
519int lirc_dev_fop_ioctl(struct inode *inode, struct file *file, 520long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
520 unsigned int cmd, unsigned long arg)
521{ 521{
522 unsigned long mode; 522 unsigned long mode;
523 int result = 0; 523 int result = 0;
524 struct irctl *ir = irctls[iminor(inode)]; 524 struct irctl *ir = file->private_data;
525 525
526 dev_dbg(ir->d.dev, LOGHEAD "ioctl called (0x%x)\n", 526 dev_dbg(ir->d.dev, LOGHEAD "ioctl called (0x%x)\n",
527 ir->d.name, ir->d.minor, cmd); 527 ir->d.name, ir->d.minor, cmd);
diff --git a/drivers/media/IR/lirc_dev.h b/drivers/media/IR/lirc_dev.h
index 4afd96a38a4..b1f60663cb3 100644
--- a/drivers/media/IR/lirc_dev.h
+++ b/drivers/media/IR/lirc_dev.h
@@ -216,8 +216,7 @@ void *lirc_get_pdata(struct file *file);
216int lirc_dev_fop_open(struct inode *inode, struct file *file); 216int lirc_dev_fop_open(struct inode *inode, struct file *file);
217int lirc_dev_fop_close(struct inode *inode, struct file *file); 217int lirc_dev_fop_close(struct inode *inode, struct file *file);
218unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait); 218unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait);
219int lirc_dev_fop_ioctl(struct inode *inode, struct file *file, 219long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
220 unsigned int cmd, unsigned long arg);
221ssize_t lirc_dev_fop_read(struct file *file, char *buffer, size_t length, 220ssize_t lirc_dev_fop_read(struct file *file, char *buffer, size_t length,
222 loff_t *ppos); 221 loff_t *ppos);
223ssize_t lirc_dev_fop_write(struct file *file, const char *buffer, size_t length, 222ssize_t lirc_dev_fop_write(struct file *file, const char *buffer, size_t length,