Commit 03fb02c6 authored by Julia Lawall's avatar Julia Lawall Committed by Mauro Carvalho Chehab

V4L/DVB (10171): Use usb_set_intfdata

This code had calls to both usb_set_intfdata and dev_set_drvdata, doing the
same thing.

The semantic patch that lead to finding this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@header@
@@

@same depends on header@
position p;
@@

usb_set_intfdata@p(...) { ... }

@depends on header@
position _p!=same.p;
identifier _f;
struct usb_interface *intf;
expression data;
@@

_f@_p(...) { <+...
- dev_set_drvdata(&intf->dev, data);
+ usb_set_intfdata(intf, data);
...+> }

// </smpl>
Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 6b55009e
...@@ -893,7 +893,6 @@ static void zr364xx_disconnect(struct usb_interface *intf) ...@@ -893,7 +893,6 @@ static void zr364xx_disconnect(struct usb_interface *intf)
{ {
struct zr364xx_camera *cam = usb_get_intfdata(intf); struct zr364xx_camera *cam = usb_get_intfdata(intf);
usb_set_intfdata(intf, NULL); usb_set_intfdata(intf, NULL);
dev_set_drvdata(&intf->dev, NULL);
dev_info(&intf->dev, DRIVER_DESC " webcam unplugged\n"); dev_info(&intf->dev, DRIVER_DESC " webcam unplugged\n");
if (cam->vdev) if (cam->vdev)
video_unregister_device(cam->vdev); video_unregister_device(cam->vdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment