All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Frank Schäfer" <fschaefer.oss@googlemail.com>
To: m.chehab@samsung.com
Cc: linux-media@vger.kernel.org,
	"Frank Schäfer" <fschaefer.oss@googlemail.com>
Subject: [RFT/RFC PATCH 4/8] em28xx: move v4l2_device_disconnect() call from the core to the v4l extension
Date: Sun, 12 Jan 2014 17:24:21 +0100	[thread overview]
Message-ID: <1389543865-2534-5-git-send-email-fschaefer.oss@googlemail.com> (raw)
In-Reply-To: <1389543865-2534-1-git-send-email-fschaefer.oss@googlemail.com>

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
---
 drivers/media/usb/em28xx/em28xx-cards.c |   10 ----------
 drivers/media/usb/em28xx/em28xx-video.c |    5 +++++
 2 Dateien geändert, 5 Zeilen hinzugefügt(+), 10 Zeilen entfernt(-)

diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c
index e0040f8..34ff918b 100644
--- a/drivers/media/usb/em28xx/em28xx-cards.c
+++ b/drivers/media/usb/em28xx/em28xx-cards.c
@@ -3338,16 +3338,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 634e88a..7535762 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;
 	}
 
+	v4l2_device_disconnect(&dev->v4l2_dev);
+
 	em28xx_uninit_usb_xfer(dev, EM28XX_ANALOG_MODE);
 
 	if (dev->radio_dev) {
@@ -1921,6 +1923,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;
 }
 
-- 
1.7.10.4


  parent reply	other threads:[~2014-01-12 16:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-12 16:24 [RFT/RFC PATCH 0/8] em28xx: move more v4l/dvb specific code to the extension modules and fix the resources handling Frank Schäfer
2014-01-12 16:24 ` [RFT/RFC PATCH 1/8] em28xx-v4l: fix device initialization in em28xx_v4l2_open() for radio and VBI mode Frank Schäfer
2014-01-12 16:24 ` [RFT/RFC PATCH 2/8] em28xx: move usb buffer pre-allocation and transfer uninit from the core to the dvb extension Frank Schäfer
2014-01-12 16:24 ` [RFT/RFC PATCH 3/8] em28xx: move usb transfer uninit on device disconnect from the core to the v4l-extension Frank Schäfer
2014-01-12 16:24 ` Frank Schäfer [this message]
2014-01-12 16:24 ` [RFT/RFC PATCH 5/8] em28xx-v4l: move v4l2_ctrl_handler freeing and v4l2_device unregistration to em28xx_v4l2_fini Frank Schäfer
2014-01-12 16:24 ` [RFT/RFC PATCH 6/8] em28xx: move v4l2 dummy clock deregistration from the core to the v4l extension Frank Schäfer
2014-01-12 16:24 ` [RFT/RFC PATCH 7/8] em28xx: always call em28xx_release_resources() in the usb disconnect handler Frank Schäfer
2014-01-12 16:24 ` [RFT/RFC PATCH 8/8] em28xx-v4l: fix the freeing of the video devices memory Frank Schäfer
2014-01-12 18:55 ` [RFT/RFC PATCH 0/8] em28xx: move more v4l/dvb specific code to the extension modules and fix the resources handling Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1389543865-2534-5-git-send-email-fschaefer.oss@googlemail.com \
    --to=fschaefer.oss@googlemail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.