return ret;
}
-static int ir_lirc_ioctl(struct inode *node, struct file *filep,
- unsigned int cmd, unsigned long arg)
+static long ir_lirc_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
{
struct lirc_codec *lirc;
struct ir_input_dev *ir_dev;
break;
default:
- return lirc_dev_fop_ioctl(node, filep, cmd, arg);
+ return lirc_dev_fop_ioctl(filep, cmd, arg);
}
return ret;
static struct file_operations lirc_fops = {
.owner = THIS_MODULE,
.write = ir_lirc_transmit_ir,
- .ioctl = ir_lirc_ioctl,
+ .unlocked_ioctl = ir_lirc_ioctl,
.read = lirc_dev_fop_read,
.poll = lirc_dev_fop_poll,
.open = lirc_dev_fop_open,
.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,
};
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;
}
retval = -ENODEV;
goto error;
}
+ file->private_data = ir;
dev_dbg(ir->d.dev, LOGHEAD "open called\n", ir->d.name, ir->d.minor);
}
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);
int lirc_dev_fop_open(struct inode *inode, struct file *file);
int lirc_dev_fop_close(struct inode *inode, struct file *file);
unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait);
-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);
ssize_t lirc_dev_fop_read(struct file *file, char *buffer, size_t length,
loff_t *ppos);
ssize_t lirc_dev_fop_write(struct file *file, const char *buffer, size_t length,