llseek: automatically add .llseek fop
[sfrench/cifs-2.6.git] / drivers / media / IR / imon.c
index 65c125e44e964ebd71ec15d955bd0a67035e7bb9..faed5a332c718f0720bd87b44dbb8f09f0d5b5fb 100644 (file)
@@ -87,7 +87,6 @@ static ssize_t lcd_write(struct file *file, const char *buf,
 struct imon_context {
        struct device *dev;
        struct ir_dev_props *props;
-       struct ir_input_dev *ir;
        /* Newer devices have two interfaces */
        struct usb_device *usbdev_intf0;
        struct usb_device *usbdev_intf1;
@@ -152,7 +151,8 @@ static const struct file_operations vfd_fops = {
        .owner          = THIS_MODULE,
        .open           = &display_open,
        .write          = &vfd_write,
-       .release        = &display_close
+       .release        = &display_close,
+       .llseek         = noop_llseek,
 };
 
 /* lcd character device file operations */
@@ -160,7 +160,8 @@ static const struct file_operations lcd_fops = {
        .owner          = THIS_MODULE,
        .open           = &display_open,
        .write          = &lcd_write,
-       .release        = &display_close
+       .release        = &display_close,
+       .llseek         = noop_llseek,
 };
 
 enum {
@@ -1656,7 +1657,6 @@ static struct input_dev *imon_init_idev(struct imon_context *ictx)
 {
        struct input_dev *idev;
        struct ir_dev_props *props;
-       struct ir_input_dev *ir;
        int ret, i;
 
        idev = input_allocate_device();
@@ -1671,12 +1671,6 @@ static struct input_dev *imon_init_idev(struct imon_context *ictx)
                goto props_alloc_failed;
        }
 
-       ir = kzalloc(sizeof(struct ir_input_dev), GFP_KERNEL);
-       if (!ir) {
-               dev_err(ictx->dev, "remote ir input dev allocation failed\n");
-               goto ir_dev_alloc_failed;
-       }
-
        snprintf(ictx->name_idev, sizeof(ictx->name_idev),
                 "iMON Remote (%04x:%04x)", ictx->vendor, ictx->product);
        idev->name = ictx->name_idev;
@@ -1706,14 +1700,9 @@ static struct input_dev *imon_init_idev(struct imon_context *ictx)
        props->change_protocol = imon_ir_change_protocol;
        ictx->props = props;
 
-       ictx->ir = ir;
-       memcpy(&ir->dev, ictx->dev, sizeof(struct device));
-
        usb_to_input_id(ictx->usbdev_intf0, &idev->id);
        idev->dev.parent = ictx->dev;
 
-       input_set_drvdata(idev, ir);
-
        ret = ir_input_register(idev, RC_MAP_IMON_PAD, props, MOD_NAME);
        if (ret < 0) {
                dev_err(ictx->dev, "remote input dev register failed\n");
@@ -1723,8 +1712,6 @@ static struct input_dev *imon_init_idev(struct imon_context *ictx)
        return idev;
 
 idev_register_failed:
-       kfree(ir);
-ir_dev_alloc_failed:
        kfree(props);
 props_alloc_failed:
        input_free_device(idev);
@@ -1944,7 +1931,6 @@ static struct imon_context *imon_init_intf0(struct usb_interface *intf)
 
 urb_submit_failed:
        ir_input_unregister(ictx->idev);
-       input_free_device(ictx->idev);
 idev_setup_failed:
 find_endpoint_failed:
        mutex_unlock(&ictx->lock);
@@ -2014,10 +2000,8 @@ static struct imon_context *imon_init_intf1(struct usb_interface *intf,
        return ictx;
 
 urb_submit_failed:
-       if (ictx->touch) {
+       if (ictx->touch)
                input_unregister_device(ictx->touch);
-               input_free_device(ictx->touch);
-       }
 touch_setup_failed:
 find_endpoint_failed:
        mutex_unlock(&ictx->lock);