From: Frank Schaefer Date: Sun, 12 Jan 2014 16:24:21 +0000 (-0300) Subject: upstream: [media] em28xx: move v4l2_device_disconnect() call from the core to the... X-Git-Tag: submit/tizen/20141121.110247~1515 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=134180efd5fb326e2455865acd14feb1fae0c954;p=platform%2Fkernel%2Flinux-3.10.git upstream: [media] em28xx: move v4l2_device_disconnect() call 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 51759cb..414bb0d 100644 --- a/drivers/media/usb/em28xx/em28xx-cards.c +++ b/drivers/media/usb/em28xx/em28xx-cards.c @@ -3214,16 +3214,6 @@ static void em28xx_usb_disconnect(struct usb_interface *interface) flush_request_modules(dev); - mutex_lock(&dev->lock); - - v4l2_device_disconnect(&dev->v4l2_dev); - - if (dev->users) - em28xx_warn("device %s is open! Deregistration and memory deallocation are deferred on close.\n", - video_device_node_name(dev->vdev)); - - mutex_unlock(&dev->lock); - em28xx_close_extension(dev); /* NOTE: must be called BEFORE the resources are released */ diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index e283d73..a6aba61e 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c @@ -1899,6 +1899,8 @@ static int em28xx_v4l2_fini(struct em28xx *dev) return 0; } + v4l2_device_disconnect(&dev->v4l2_dev); + em28xx_uninit_usb_xfer(dev, EM28XX_ANALOG_MODE); if (dev->radio_dev) { @@ -1927,6 +1929,9 @@ static int em28xx_v4l2_fini(struct em28xx *dev) dev->vdev = NULL; } + if (dev->users) + em28xx_warn("Device is open ! Deregistration and memory deallocation are deferred on close.\n"); + return 0; }