Skip to content

Commit

Permalink
V4L/DVB: usbvision: don't use usb_set_intfdata, let v4l2_device_regis…
Browse files Browse the repository at this point in the history
…ter handle this

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>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed May 19, 2010
1 parent f2b305c commit aeb506a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/media/video/usbvision/usbvision-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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, "");

Expand All @@ -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);

Expand Down
5 changes: 5 additions & 0 deletions drivers/media/video/usbvision/usbvision.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit aeb506a

Please sign in to comment.