[<prev] [next>] [day] [month] [year] [list]
Date: Thu, 1 Jan 2009 18:14:58 +0100 (CET)
From: Julia Lawall <julia@...u.dk>
To: mchehab@...radead.org, v4l-dvb-maintainer@...uxtv.org,
video4linux-list@...hat.com, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [PATCH 2/2] drivers/media/video: Use usb_set_intfdata
From: Julia Lawall <julia@...u.dk>
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@
@@
#include <linux/usb.h>
@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: Julia Lawall <julia@...u.dk>
---
drivers/media/video/zr364xx.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/media/video/zr364xx.c b/drivers/media/video/zr364xx.c
index a1d81ed..ab7cbbd 100644
--- a/drivers/media/video/zr364xx.c
+++ b/drivers/media/video/zr364xx.c
@@ -894,7 +894,6 @@ static void zr364xx_disconnect(struct usb_interface *intf)
{
struct zr364xx_camera *cam = usb_get_intfdata(intf);
usb_set_intfdata(intf, NULL);
- dev_set_drvdata(&intf->dev, NULL);
dev_info(&intf->dev, DRIVER_DESC " webcam unplugged\n");
if (cam->vdev)
video_unregister_device(cam->vdev);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists