summaryrefslogtreecommitdiff
path: root/drivers/media/usb/em28xx/em28xx-video.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-12-07 14:34:22 -0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-12-12 07:30:44 -0200
commitc6d48134cb2682516ed50ca0cea2675d27d985e8 (patch)
tree65e9a71ad49b9e5d9930709dd56bd82cc2c591f2 /drivers/media/usb/em28xx/em28xx-video.c
parent29b05e22f5c68c657f5ec30a31023b81124287fb (diff)
[media] em28xx: don't store usb_device at struct em28xx
Now that we're storing usb_interface at em28xx struct, there's no good reason to keep storing usb_device, as we can get it from usb_interface. So, get rid of it. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/usb/em28xx/em28xx-video.c')
-rw-r--r--drivers/media/usb/em28xx/em28xx-video.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
index 4780f6492329..8d93100334ea 100644
--- a/drivers/media/usb/em28xx/em28xx-video.c
+++ b/drivers/media/usb/em28xx/em28xx-video.c
@@ -360,6 +360,7 @@ static int em28xx_resolution_set(struct em28xx *dev)
static int em28xx_set_alternate(struct em28xx *dev)
{
struct em28xx_v4l2 *v4l2 = dev->v4l2;
+ struct usb_device *udev = interface_to_usbdev(dev->intf);
int errCode;
int i;
unsigned int min_pkt_size = v4l2->width * 2 + 4;
@@ -411,7 +412,7 @@ set_alt:
}
em28xx_videodbg("setting alternate %d with wMaxPacketSize=%u\n",
dev->alt, dev->max_pkt_size);
- errCode = usb_set_interface(dev->udev, dev->ifnum, dev->alt);
+ errCode = usb_set_interface(udev, dev->ifnum, dev->alt);
if (errCode < 0) {
dev_err(&dev->intf->dev,
"cannot change alternate number to %d (error=%i)\n",
@@ -1859,10 +1860,11 @@ static int vidioc_querycap(struct file *file, void *priv,
struct video_device *vdev = video_devdata(file);
struct em28xx *dev = video_drvdata(file);
struct em28xx_v4l2 *v4l2 = dev->v4l2;
+ struct usb_device *udev = interface_to_usbdev(dev->intf);
strlcpy(cap->driver, "em28xx", sizeof(cap->driver));
strlcpy(cap->card, em28xx_boards[dev->model].name, sizeof(cap->card));
- usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info));
+ usb_make_path(udev, cap->bus_info, sizeof(cap->bus_info));
if (vdev->vfl_type == VFL_TYPE_GRABBER)
cap->device_caps = V4L2_CAP_READWRITE |
@@ -2187,6 +2189,7 @@ static int em28xx_v4l2_close(struct file *filp)
{
struct em28xx *dev = video_drvdata(filp);
struct em28xx_v4l2 *v4l2 = dev->v4l2;
+ struct usb_device *udev = interface_to_usbdev(dev->intf);
int errCode;
em28xx_videodbg("users=%d\n", v4l2->users);
@@ -2208,7 +2211,7 @@ static int em28xx_v4l2_close(struct file *filp)
/* set alternate 0 */
dev->alt = 0;
em28xx_videodbg("setting alternate 0\n");
- errCode = usb_set_interface(dev->udev, 0, 0);
+ errCode = usb_set_interface(udev, 0, 0);
if (errCode < 0) {
dev_err(&dev->intf->dev,
"cannot change alternate number to 0 (error=%i)\n",