From: Frank Schaefer Date: Sun, 12 Jan 2014 16:24:20 +0000 (-0300) Subject: [media] em28xx: move usb transfer uninit on device disconnect from the core to the... X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=23e8642cc48171151cc89a33eb84c929dcdf2c19;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [media] em28xx: move usb transfer uninit on device disconnect from the core to the v4l-extension Signed-off-by: Frank Schäfer Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c index 7ae6e502da66..ecf92d4cde4f 100644 --- a/drivers/media/usb/em28xx/em28xx-cards.c +++ b/drivers/media/usb/em28xx/em28xx-cards.c @@ -3391,12 +3391,10 @@ static void em28xx_usb_disconnect(struct usb_interface *interface) v4l2_device_disconnect(&dev->v4l2_dev); - if (dev->users) { + if (dev->users) em28xx_warn("device %s is open! Deregistration and memory deallocation are deferred on close.\n", video_device_node_name(dev->vdev)); - em28xx_uninit_usb_xfer(dev, EM28XX_ANALOG_MODE); - } mutex_unlock(&dev->lock); em28xx_close_extension(dev); diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index efbc877c6181..a5a665b41060 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c @@ -1893,6 +1893,8 @@ static int em28xx_v4l2_fini(struct em28xx *dev) return 0; } + em28xx_uninit_usb_xfer(dev, EM28XX_ANALOG_MODE); + if (dev->radio_dev) { if (video_is_registered(dev->radio_dev)) video_unregister_device(dev->radio_dev);