summaryrefslogtreecommitdiffstats
path: root/drivers/media/IR/ir-lirc-codec.c
diff options
context:
space:
mode:
authorJarod Wilson2010-10-08 22:24:21 +0200
committerMauro Carvalho Chehab2010-10-21 05:18:34 +0200
commitbe1f985ffa49467f604318182616678b3e5184fd (patch)
tree3445d817db48005ed442fd03009ac6ff68e84514 /drivers/media/IR/ir-lirc-codec.c
parent[media] IR/Kconfig: sort hardware entries alphabetically (diff)
downloadkernel-qcow2-linux-be1f985ffa49467f604318182616678b3e5184fd.tar.gz
kernel-qcow2-linux-be1f985ffa49467f604318182616678b3e5184fd.tar.xz
kernel-qcow2-linux-be1f985ffa49467f604318182616678b3e5184fd.zip
[media] IR/lirc: further ioctl portability fixups
>From Joris van Rantwijk <jorispubl@xs4all.nl>: I tested lirc_serial and found that it works fine. Except the LIRC ioctls do not work in my 64-bit-kernel/32-bit-user setup. I added compat_ioctl entries in the drivers to fix this. While doing so, I noticed inconsistencies in the argument type of the LIRC ioctls. All ioctls are declared in lirc.h as having argument type __u32, however there are a few places where the driver calls get_user/put_user with an unsigned long argument. The patch below changes lirc_dev and lirc_serial to use __u32 for all ioctl arguments, and adds compat_ioctl entries. It should probably also be done in the other low-level drivers, but I don't have hardware to test those. I've dropped the .compat_ioctl addition from Joris' original patch, as I swear the non-compat definition should now work for both 32-bit and 64-bit userspace. Technically, I think we still need/want a in getting a reply to you). Reported-by: Joris van Rantwijk <jorispubl@xs4all.nl> Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/IR/ir-lirc-codec.c')
-rw-r--r--drivers/media/IR/ir-lirc-codec.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/media/IR/ir-lirc-codec.c b/drivers/media/IR/ir-lirc-codec.c
index e63f757d5d72..c6d5b3eb1325 100644
--- a/drivers/media/IR/ir-lirc-codec.c
+++ b/drivers/media/IR/ir-lirc-codec.c
@@ -102,7 +102,7 @@ static long ir_lirc_ioctl(struct file *filep, unsigned int cmd,
struct ir_input_dev *ir_dev;
int ret = 0;
void *drv_data;
- unsigned long val = 0;
+ __u32 val = 0;
lirc = lirc_get_pdata(filep);
if (!lirc)
@@ -115,7 +115,7 @@ static long ir_lirc_ioctl(struct file *filep, unsigned int cmd,
drv_data = ir_dev->props->priv;
if (_IOC_DIR(cmd) & _IOC_WRITE) {
- ret = get_user(val, (unsigned long *)arg);
+ ret = get_user(val, (__u32 *)arg);
if (ret)
return ret;
}
@@ -135,14 +135,14 @@ static long ir_lirc_ioctl(struct file *filep, unsigned int cmd,
/* TX settings */
case LIRC_SET_TRANSMITTER_MASK:
if (ir_dev->props->s_tx_mask)
- ret = ir_dev->props->s_tx_mask(drv_data, (u32)val);
+ ret = ir_dev->props->s_tx_mask(drv_data, val);
else
return -EINVAL;
break;
case LIRC_SET_SEND_CARRIER:
if (ir_dev->props->s_tx_carrier)
- ir_dev->props->s_tx_carrier(drv_data, (u32)val);
+ ir_dev->props->s_tx_carrier(drv_data, val);
else
return -EINVAL;
break;
@@ -212,7 +212,7 @@ static long ir_lirc_ioctl(struct file *filep, unsigned int cmd,
}
if (_IOC_DIR(cmd) & _IOC_READ)
- ret = put_user(val, (unsigned long *)arg);
+ ret = put_user(val, (__u32 *)arg);
return ret;
}