aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/rc/lirc_dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/rc/lirc_dev.c')
-rw-r--r--drivers/media/rc/lirc_dev.c62
1 files changed, 3 insertions, 59 deletions
diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c
index 3cc95deaa84e..95058ea01e62 100644
--- a/drivers/media/rc/lirc_dev.c
+++ b/drivers/media/rc/lirc_dev.c
@@ -109,6 +109,7 @@ EXPORT_SYMBOL(lirc_free_device);
int lirc_register_device(struct lirc_dev *d)
{
+ struct rc_dev *rcdev = d->rdev;
int minor;
int err;
@@ -146,7 +147,7 @@ int lirc_register_device(struct lirc_dev *d)
/* some safety check 8-) */
d->name[sizeof(d->name) - 1] = '\0';
- if (LIRC_CAN_REC(d->features)) {
+ if (rcdev->driver_type == RC_DRIVER_IR_RAW) {
err = lirc_allocate_buffer(d);
if (err)
return err;
@@ -290,63 +291,6 @@ unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait)
}
EXPORT_SYMBOL(lirc_dev_fop_poll);
-long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
-{
- struct rc_dev *rcdev = file->private_data;
- struct lirc_dev *d = rcdev->lirc_dev;
- __u32 mode;
- int result;
-
- dev_dbg(&d->dev, LOGHEAD "ioctl called (0x%x)\n",
- d->name, d->minor, cmd);
-
- result = mutex_lock_interruptible(&d->mutex);
- if (result)
- return result;
-
- if (!d->attached) {
- result = -ENODEV;
- goto out;
- }
-
- switch (cmd) {
- case LIRC_GET_FEATURES:
- result = put_user(d->features, (__u32 __user *)arg);
- break;
- case LIRC_GET_REC_MODE:
- if (!LIRC_CAN_REC(d->features)) {
- result = -ENOTTY;
- break;
- }
-
- result = put_user(LIRC_REC2MODE
- (d->features & LIRC_CAN_REC_MASK),
- (__u32 __user *)arg);
- break;
- case LIRC_SET_REC_MODE:
- if (!LIRC_CAN_REC(d->features)) {
- result = -ENOTTY;
- break;
- }
-
- result = get_user(mode, (__u32 __user *)arg);
- if (!result && !(LIRC_MODE2REC(mode) & d->features))
- result = -EINVAL;
- /*
- * FIXME: We should actually set the mode somehow but
- * for now, lirc_serial doesn't support mode changing either
- */
- break;
- default:
- result = -ENOTTY;
- }
-
-out:
- mutex_unlock(&d->mutex);
- return result;
-}
-EXPORT_SYMBOL(lirc_dev_fop_ioctl);
-
ssize_t lirc_dev_fop_read(struct file *file,
char __user *buffer,
size_t length,
@@ -375,7 +319,7 @@ ssize_t lirc_dev_fop_read(struct file *file,
goto out_locked;
}
- if (!LIRC_CAN_REC(d->features)) {
+ if (rcdev->driver_type != RC_DRIVER_IR_RAW) {
ret = -EINVAL;
goto out_locked;
}

Privacy Policy