diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-12-07 14:34:22 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-12-12 07:30:44 -0200 |
commit | c6d48134cb2682516ed50ca0cea2675d27d985e8 (patch) | |
tree | 65e9a71ad49b9e5d9930709dd56bd82cc2c591f2 /drivers/media/usb/em28xx/em28xx-cards.c | |
parent | 29b05e22f5c68c657f5ec30a31023b81124287fb (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-cards.c')
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-cards.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c index 56739ce6ce16..23c67494762d 100644 --- a/drivers/media/usb/em28xx/em28xx-cards.c +++ b/drivers/media/usb/em28xx/em28xx-cards.c @@ -3188,6 +3188,8 @@ static void em28xx_unregister_media_device(struct em28xx *dev) */ static void em28xx_release_resources(struct em28xx *dev) { + struct usb_device *udev = interface_to_usbdev(dev->intf); + /*FIXME: I2C IR should be disconnected */ mutex_lock(&dev->lock); @@ -3198,7 +3200,7 @@ static void em28xx_release_resources(struct em28xx *dev) em28xx_i2c_unregister(dev, 1); em28xx_i2c_unregister(dev, 0); - usb_put_dev(dev->udev); + usb_put_dev(udev); /* Mark device as unused */ clear_bit(dev->devno, em28xx_devused); @@ -3238,7 +3240,6 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev, int retval; const char *chip_name = NULL; - dev->udev = udev; dev->intf = interface; mutex_init(&dev->ctrl_urb_lock); spin_lock_init(&dev->slock); @@ -3277,9 +3278,8 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev, break; case CHIP_ID_EM2820: chip_name = "em2710/2820"; - if (le16_to_cpu(dev->udev->descriptor.idVendor) - == 0xeb1a) { - __le16 idProd = dev->udev->descriptor.idProduct; + if (le16_to_cpu(udev->descriptor.idVendor) == 0xeb1a) { + __le16 idProd = udev->descriptor.idProduct; if (le16_to_cpu(idProd) == 0x2710) chip_name = "em2710"; |