From patchwork Sun Jan 12 16:24:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Frank_Sch=C3=A4fer?= X-Patchwork-Id: 3472311 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DC36EC02DC for ; Sun, 12 Jan 2014 16:23:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1A87620122 for ; Sun, 12 Jan 2014 16:23:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4157020121 for ; Sun, 12 Jan 2014 16:23:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751212AbaALQXw (ORCPT ); Sun, 12 Jan 2014 11:23:52 -0500 Received: from mail-ea0-f170.google.com ([209.85.215.170]:39732 "EHLO mail-ea0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751028AbaALQXr (ORCPT ); Sun, 12 Jan 2014 11:23:47 -0500 Received: by mail-ea0-f170.google.com with SMTP id k10so2893067eaj.29 for ; Sun, 12 Jan 2014 08:23:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=MFoUCwCIha0AvSWpDk7EYNuhkAYtRTBDJ0EnHTDMCPo=; b=qaqe3vSlsMXGEvMcLmrv239pzJtjdxhuBFi53gihH0fb40SeZrumtrO3U3dCXgeq63 d2KbWkGba0znNwo8afGz2uUpeTKkitAQVg+cxhiqhYJuauLjwdBxZu8BqGG3AtaxXF+u IhcoqujHR9OoEFKwfK5RTxES/gXDWsdalK1S2dK0YK+uokymFJWTxkfjTiHs3Ub9o4N+ EGek3fNP1m9NFnlZXRVWzyMAQLy5v5jQOrkAXuctiMDlXHc5diserGSLivDVX/dz6aAA jbIhs8M8XMiXuO+Zahyv+9BkyEol31EDuIrYKkA0uheqp7JTd/UfZHmyyFFMWE3SKdu6 GEGA== X-Received: by 10.14.88.5 with SMTP id z5mr9945428eee.101.1389543826428; Sun, 12 Jan 2014 08:23:46 -0800 (PST) Received: from Athlon64X2-5000.site (ip-178-200-114-182.unitymediagroup.de. [178.200.114.182]) by mx.google.com with ESMTPSA id o47sm32222713eem.21.2014.01.12.08.23.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Jan 2014 08:23:46 -0800 (PST) From: =?UTF-8?q?Frank=20Sch=C3=A4fer?= To: m.chehab@samsung.com Cc: linux-media@vger.kernel.org, =?UTF-8?q?Frank=20Sch=C3=A4fer?= 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 Message-Id: <1389543865-2534-5-git-send-email-fschaefer.oss@googlemail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1389543865-2534-1-git-send-email-fschaefer.oss@googlemail.com> References: <1389543865-2534-1-git-send-email-fschaefer.oss@googlemail.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Frank Schäfer --- 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; }