diff options
author | Jarod Wilson <jarod@redhat.com> | 2010-10-09 14:07:06 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-20 23:18:36 -0400 |
commit | 8be292cc035ebc3422f08e84682626dd8ed8334b (patch) | |
tree | d9dee450677123f2f93a4dd7edb9d127d236c7e3 | |
parent | a126681810a327bee60a58ac5ad77f4518cf7a5f (diff) |
[media] lirc: wire up .compat_ioctl to main ioctl handler
As pointed out (and tested) by Joris van Rantwijk, we do actually need
to wire up .compat_ioctl for 32-bit lirc userspace to work with 64-bit
lirc kernelspace. Do it. And add a check to make sure we get a valid
irctl in the ioctl handler.
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/IR/ir-lirc-codec.c | 3 | ||||
-rw-r--r-- | drivers/media/IR/lirc_dev.c | 8 | ||||
-rw-r--r-- | drivers/staging/lirc/lirc_it87.c | 3 | ||||
-rw-r--r-- | drivers/staging/lirc/lirc_parallel.c | 3 | ||||
-rw-r--r-- | drivers/staging/lirc/lirc_serial.c | 3 | ||||
-rw-r--r-- | drivers/staging/lirc/lirc_sir.c | 3 | ||||
-rw-r--r-- | drivers/staging/lirc/lirc_zilog.c | 3 |
7 files changed, 26 insertions, 0 deletions
diff --git a/drivers/media/IR/ir-lirc-codec.c b/drivers/media/IR/ir-lirc-codec.c index c6d5b3eb1325..20ac9a4ce522 100644 --- a/drivers/media/IR/ir-lirc-codec.c +++ b/drivers/media/IR/ir-lirc-codec.c | |||
@@ -231,6 +231,9 @@ static struct file_operations lirc_fops = { | |||
231 | .owner = THIS_MODULE, | 231 | .owner = THIS_MODULE, |
232 | .write = ir_lirc_transmit_ir, | 232 | .write = ir_lirc_transmit_ir, |
233 | .unlocked_ioctl = ir_lirc_ioctl, | 233 | .unlocked_ioctl = ir_lirc_ioctl, |
234 | #ifdef CONFIG_COMPAT | ||
235 | .compat_ioctl = ir_lirc_ioctl, | ||
236 | #endif | ||
234 | .read = lirc_dev_fop_read, | 237 | .read = lirc_dev_fop_read, |
235 | .poll = lirc_dev_fop_poll, | 238 | .poll = lirc_dev_fop_poll, |
236 | .open = lirc_dev_fop_open, | 239 | .open = lirc_dev_fop_open, |
diff --git a/drivers/media/IR/lirc_dev.c b/drivers/media/IR/lirc_dev.c index e4e4d99725e6..c20cfd1d5557 100644 --- a/drivers/media/IR/lirc_dev.c +++ b/drivers/media/IR/lirc_dev.c | |||
@@ -161,6 +161,9 @@ static struct file_operations fops = { | |||
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 | .unlocked_ioctl = lirc_dev_fop_ioctl, | 163 | .unlocked_ioctl = lirc_dev_fop_ioctl, |
164 | #ifdef CONFIG_COMPAT | ||
165 | .compat_ioctl = lirc_dev_fop_ioctl, | ||
166 | #endif | ||
164 | .open = lirc_dev_fop_open, | 167 | .open = lirc_dev_fop_open, |
165 | .release = lirc_dev_fop_close, | 168 | .release = lirc_dev_fop_close, |
166 | }; | 169 | }; |
@@ -528,6 +531,11 @@ long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
528 | int result = 0; | 531 | int result = 0; |
529 | struct irctl *ir = file->private_data; | 532 | struct irctl *ir = file->private_data; |
530 | 533 | ||
534 | if (!ir) { | ||
535 | printk(KERN_ERR "lirc_dev: %s: no irctl found!\n", __func__); | ||
536 | return -ENODEV; | ||
537 | } | ||
538 | |||
531 | dev_dbg(ir->d.dev, LOGHEAD "ioctl called (0x%x)\n", | 539 | dev_dbg(ir->d.dev, LOGHEAD "ioctl called (0x%x)\n", |
532 | ir->d.name, ir->d.minor, cmd); | 540 | ir->d.name, ir->d.minor, cmd); |
533 | 541 | ||
diff --git a/drivers/staging/lirc/lirc_it87.c b/drivers/staging/lirc/lirc_it87.c index 7d1b42735697..bd5006c8fcaa 100644 --- a/drivers/staging/lirc/lirc_it87.c +++ b/drivers/staging/lirc/lirc_it87.c | |||
@@ -339,6 +339,9 @@ static const struct file_operations lirc_fops = { | |||
339 | .write = lirc_write, | 339 | .write = lirc_write, |
340 | .poll = lirc_poll, | 340 | .poll = lirc_poll, |
341 | .unlocked_ioctl = lirc_ioctl, | 341 | .unlocked_ioctl = lirc_ioctl, |
342 | #ifdef CONFIG_COMPAT | ||
343 | .compat_ioctl = lirc_ioctl, | ||
344 | #endif | ||
342 | .open = lirc_open, | 345 | .open = lirc_open, |
343 | .release = lirc_close, | 346 | .release = lirc_close, |
344 | }; | 347 | }; |
diff --git a/drivers/staging/lirc/lirc_parallel.c b/drivers/staging/lirc/lirc_parallel.c index be3d60d9a498..b8cce87c7032 100644 --- a/drivers/staging/lirc/lirc_parallel.c +++ b/drivers/staging/lirc/lirc_parallel.c | |||
@@ -546,6 +546,9 @@ static const struct file_operations lirc_fops = { | |||
546 | .write = lirc_write, | 546 | .write = lirc_write, |
547 | .poll = lirc_poll, | 547 | .poll = lirc_poll, |
548 | .unlocked_ioctl = lirc_ioctl, | 548 | .unlocked_ioctl = lirc_ioctl, |
549 | #ifdef CONFIG_COMPAT | ||
550 | .compat_ioctl = lirc_ioctl, | ||
551 | #endif | ||
549 | .open = lirc_open, | 552 | .open = lirc_open, |
550 | .release = lirc_close | 553 | .release = lirc_close |
551 | }; | 554 | }; |
diff --git a/drivers/staging/lirc/lirc_serial.c b/drivers/staging/lirc/lirc_serial.c index 02906b432234..05a9bf3980ab 100644 --- a/drivers/staging/lirc/lirc_serial.c +++ b/drivers/staging/lirc/lirc_serial.c | |||
@@ -1053,6 +1053,9 @@ static const struct file_operations lirc_fops = { | |||
1053 | .owner = THIS_MODULE, | 1053 | .owner = THIS_MODULE, |
1054 | .write = lirc_write, | 1054 | .write = lirc_write, |
1055 | .unlocked_ioctl = lirc_ioctl, | 1055 | .unlocked_ioctl = lirc_ioctl, |
1056 | #ifdef CONFIG_COMPAT | ||
1057 | .compat_ioctl = lirc_ioctl, | ||
1058 | #endif | ||
1056 | .read = lirc_dev_fop_read, | 1059 | .read = lirc_dev_fop_read, |
1057 | .poll = lirc_dev_fop_poll, | 1060 | .poll = lirc_dev_fop_poll, |
1058 | .open = lirc_dev_fop_open, | 1061 | .open = lirc_dev_fop_open, |
diff --git a/drivers/staging/lirc/lirc_sir.c b/drivers/staging/lirc/lirc_sir.c index 10354f9a3804..c4cb3aa842db 100644 --- a/drivers/staging/lirc/lirc_sir.c +++ b/drivers/staging/lirc/lirc_sir.c | |||
@@ -456,6 +456,9 @@ static const struct file_operations lirc_fops = { | |||
456 | .write = lirc_write, | 456 | .write = lirc_write, |
457 | .poll = lirc_poll, | 457 | .poll = lirc_poll, |
458 | .unlocked_ioctl = lirc_ioctl, | 458 | .unlocked_ioctl = lirc_ioctl, |
459 | #ifdef CONFIG_COMPAT | ||
460 | .compat_ioctl = lirc_ioctl, | ||
461 | #endif | ||
459 | .open = lirc_dev_fop_open, | 462 | .open = lirc_dev_fop_open, |
460 | .release = lirc_dev_fop_close, | 463 | .release = lirc_dev_fop_close, |
461 | }; | 464 | }; |
diff --git a/drivers/staging/lirc/lirc_zilog.c b/drivers/staging/lirc/lirc_zilog.c index 100caab10451..d92064498523 100644 --- a/drivers/staging/lirc/lirc_zilog.c +++ b/drivers/staging/lirc/lirc_zilog.c | |||
@@ -1139,6 +1139,9 @@ static const struct file_operations lirc_fops = { | |||
1139 | .write = write, | 1139 | .write = write, |
1140 | .poll = poll, | 1140 | .poll = poll, |
1141 | .unlocked_ioctl = ioctl, | 1141 | .unlocked_ioctl = ioctl, |
1142 | #ifdef CONFIG_COMPAT | ||
1143 | .compat_ioctl = ioctl, | ||
1144 | #endif | ||
1142 | .open = open, | 1145 | .open = open, |
1143 | .release = close | 1146 | .release = close |
1144 | }; | 1147 | }; |