From patchwork Thu May 29 12:20:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 4264061 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 644E79F1E7 for ; Thu, 29 May 2014 12:20:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8D06020340 for ; Thu, 29 May 2014 12:20:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 45F37202F8 for ; Thu, 29 May 2014 12:20:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757331AbaE2MUZ (ORCPT ); Thu, 29 May 2014 08:20:25 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:35994 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756322AbaE2MUY (ORCPT ); Thu, 29 May 2014 08:20:24 -0400 Received: from [201.74.152.26] (helo=smtp.w2.samsung.com) by bombadil.infradead.org with esmtpsa (Exim 4.80.1 #2 (Red Hat Linux)) id 1WpzJm-0005sK-Dk; Thu, 29 May 2014 12:20:22 +0000 Received: from mchehab by smtp.w2.samsung.com with local (Exim 4.80.1) (envelope-from ) id 1WpzJi-0005BF-EC; Thu, 29 May 2014 09:20:18 -0300 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab Subject: [PATCH 1/5] dvbdev: add a dvb_detach() macro Date: Thu, 29 May 2014 09:20:13 -0300 Message-Id: <1401366017-19874-2-git-send-email-m.chehab@samsung.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1401366017-19874-1-git-send-email-m.chehab@samsung.com> References: <1401366017-19874-1-git-send-email-m.chehab@samsung.com> To: unlisted-recipients:; (no To-header on input) 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.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 The dvb_attach() was unbalanced, as there was no dvb_dettach. Ok, on current cases, the dettach is done by dvbdev, but that are some future corner cases where we may need to do this before registering the frontend. So, add a dvb_detach() and use it at dvb_frontend.c. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb-core/dvb_frontend.c | 8 ++++---- drivers/media/dvb-core/dvbdev.h | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c index 6ce435ac866f..6cc2631d8f0e 100644 --- a/drivers/media/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb-core/dvb_frontend.c @@ -2666,20 +2666,20 @@ void dvb_frontend_detach(struct dvb_frontend* fe) if (fe->ops.release_sec) { fe->ops.release_sec(fe); - symbol_put_addr(fe->ops.release_sec); + dvb_detach(fe->ops.release_sec); } if (fe->ops.tuner_ops.release) { fe->ops.tuner_ops.release(fe); - symbol_put_addr(fe->ops.tuner_ops.release); + dvb_detach(fe->ops.tuner_ops.release); } if (fe->ops.analog_ops.release) { fe->ops.analog_ops.release(fe); - symbol_put_addr(fe->ops.analog_ops.release); + dvb_detach(fe->ops.analog_ops.release); } ptr = (void*)fe->ops.release; if (ptr) { fe->ops.release(fe); - symbol_put_addr(ptr); + dvb_detach(ptr); } } #else diff --git a/drivers/media/dvb-core/dvbdev.h b/drivers/media/dvb-core/dvbdev.h index 93a9470d3f0c..f96b28e7fc95 100644 --- a/drivers/media/dvb-core/dvbdev.h +++ b/drivers/media/dvb-core/dvbdev.h @@ -136,11 +136,15 @@ extern int dvb_usercopy(struct file *file, unsigned int cmd, unsigned long arg, __r; \ }) +#define dvb_detach(FUNC) symbol_put_addr(FUNC) + #else #define dvb_attach(FUNCTION, ARGS...) ({ \ FUNCTION(ARGS); \ }) +#define dvb_detach(FUNC) {} + #endif #endif /* #ifndef _DVBDEV_H_ */