From patchwork Sat Jul 12 16:44:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 4539751 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9355D9F36A for ; Sat, 12 Jul 2014 16:45:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BF4D6201C7 for ; Sat, 12 Jul 2014 16:45:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E2B52201BF for ; Sat, 12 Jul 2014 16:45:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752829AbaGLQpI (ORCPT ); Sat, 12 Jul 2014 12:45:08 -0400 Received: from qmta02.emeryville.ca.mail.comcast.net ([76.96.30.24]:46129 "EHLO qmta02.emeryville.ca.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752441AbaGLQog (ORCPT ); Sat, 12 Jul 2014 12:44:36 -0400 Received: from omta13.emeryville.ca.mail.comcast.net ([76.96.30.52]) by qmta02.emeryville.ca.mail.comcast.net with comcast id RUhr1o00117UAYkA2UkcBR; Sat, 12 Jul 2014 16:44:36 +0000 Received: from mail.gonehiking.org ([50.134.149.16]) by omta13.emeryville.ca.mail.comcast.net with comcast id RUkb1o0090MU7Qa8ZUkbG0; Sat, 12 Jul 2014 16:44:36 +0000 Received: from lorien.internal (lorien-wl.internal [192.168.1.40]) by mail.gonehiking.org (Postfix) with ESMTP id D06B9423F7; Sat, 12 Jul 2014 10:44:34 -0600 (MDT) From: Shuah Khan To: m.chehab@samsung.com, dheitmueller@kernellabs.com, olebowle@gmx.com Cc: Shuah Khan , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] media: em28xx-dvb update fe exit flag to indicate device disconnect Date: Sat, 12 Jul 2014 10:44:13 -0600 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1405183476; bh=QwHCKmLJoc8aryHIgaXOvX3O/mNi+PZMQVyvKvtYac4=; h=Received:Received:Received:From:To:Subject:Date:Message-Id; b=LkJtNK8a0n4glqyk/J2xERigR81wgOESG68YkC52mCxJVTvpMsH04ueXKpVWmL99A VaBljR1h+y0RrFahNMG5w7axFieZ0WALHhF5QruSxXn9WTRQ0Mk0YbkyRS6UJhGi1P V58tmH9uOBpTfvVoedq0wfjGnXLCCvt16le22x5uPlsdMKfbGnzxvFRx9IrZ0GidUN VmZ6zRTYPZcw77T9jVIKnw9hddK/cAjWzAKIeu/98vx84hsGar/xCez1LHsaBV0f+u VNqFILLq1qoeKFSbpU0xbjhY+1lwCVrG63Pna5wNCDfpZZSZXQR2Yzwl30zpxf7sWn CS4IfP+WZBttw== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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 Change em28xx_dvb_fini() to set fe exit flag to DVB_FE_DEVICE_REMOVED when device is disconnected. em28xx maintains device disconnect status in em28xx device. fe drivers will be able to now check the fe exit status to avoid accessing the device, from their release interfaces when called from disconnect path. This change depends on dvb-core change that exports fe exit flag by moving it from fepriv to fe. Signed-off-by: Shuah Khan --- drivers/media/usb/em28xx/em28xx-dvb.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c index 8d5cb62..5663d62 100644 --- a/drivers/media/usb/em28xx/em28xx-dvb.c +++ b/drivers/media/usb/em28xx/em28xx-dvb.c @@ -1668,10 +1668,14 @@ static int em28xx_dvb_fini(struct em28xx *dev) if (dev->disconnected) { /* We cannot tell the device to sleep * once it has been unplugged. */ - if (dvb->fe[0]) + if (dvb->fe[0]) { prevent_sleep(&dvb->fe[0]->ops); - if (dvb->fe[1]) + dvb->fe[0]->exit = DVB_FE_DEVICE_REMOVED; + } + if (dvb->fe[1]) { prevent_sleep(&dvb->fe[1]->ops); + dvb->fe[1]->exit = DVB_FE_DEVICE_REMOVED; + } } em28xx_unregister_dvb(dvb);