V4L/DVB: usbvision: don't use usb_set_intfdata, let v4l2_device_register handle this
authorHans Verkuil <hverkuil@xs4all.nl>
Sun, 2 May 2010 12:00:13 +0000 (09:00 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 19 May 2010 15:58:57 +0000 (12:58 -0300)
v4l2_device_register already sets intfdata, no need to do this again.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/usbvision/usbvision-video.c
drivers/media/video/usbvision/usbvision.h

index d91f016680748202ef475e3a41c74ad3cec16a46..6248a639ba2d2ab6e097f5770a5f2b69fec643b1 100644 (file)
@@ -1649,8 +1649,6 @@ static int __devinit usbvision_probe(struct usb_interface *intf,
        usbvision_configure_video(usbvision);
        mutex_unlock(&usbvision->lock);
 
-
-       usb_set_intfdata (intf, usbvision);
        usbvision_create_sysfs(usbvision->vdev);
 
        PDEBUG(DBG_PROBE, "success");
@@ -1668,7 +1666,7 @@ static int __devinit usbvision_probe(struct usb_interface *intf,
  */
 static void __devexit usbvision_disconnect(struct usb_interface *intf)
 {
-       struct usb_usbvision *usbvision = usb_get_intfdata(intf);
+       struct usb_usbvision *usbvision = to_usbvision(usb_get_intfdata(intf));
 
        PDEBUG(DBG_PROBE, "");
 
@@ -1677,7 +1675,6 @@ static void __devexit usbvision_disconnect(struct usb_interface *intf)
                        "%s: usb_get_intfdata() failed\n", __func__);
                return;
        }
-       usb_set_intfdata (intf, NULL);
 
        mutex_lock(&usbvision->lock);
 
index 5ab936e252fe3de94ee4582551dcf3d30a398e1b..d1b3cc0cd87fef89df068ff97426827a1ec4a722 100644 (file)
@@ -462,6 +462,11 @@ struct usb_usbvision {
        int ComprBlockTypes[4];
 };
 
+static inline struct usb_usbvision *to_usbvision(struct v4l2_device *v4l2_dev)
+{
+       return container_of(v4l2_dev, struct usb_usbvision, v4l2_dev);
+}
+
 #define call_all(usbvision, o, f, args...) \
        v4l2_device_call_all(&usbvision->v4l2_dev, 0, o, f, ##args)