From patchwork Sat Mar 15 13:43:12 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: 3837521 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 275C2BF540 for ; Sat, 15 Mar 2014 13:44:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 40CD020170 for ; Sat, 15 Mar 2014 13:44:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 059962013A for ; Sat, 15 Mar 2014 13:44:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756495AbaCONoJ (ORCPT ); Sat, 15 Mar 2014 09:44:09 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:45979 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755691AbaCONoI (ORCPT ); Sat, 15 Mar 2014 09:44:08 -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 1WOosf-0000ar-5x; Sat, 15 Mar 2014 13:44:05 +0000 Received: from mchehab by smtp.w2.samsung.com with local (Exim 4.80.1) (envelope-from ) id 1WOors-0007bU-E9; Sat, 15 Mar 2014 10:43:16 -0300 From: Mauro Carvalho Chehab To: Fengguang Wu Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab Subject: [RFC PATCH 1/3] dvbdev: add a dvb_dettach() macro Date: Sat, 15 Mar 2014 10:43:12 -0300 Message-Id: <1394890994-29185-2-git-send-email-m.chehab@samsung.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1394890994-29185-1-git-send-email-m.chehab@samsung.com> References: <1394890994-29185-1-git-send-email-m.chehab@samsung.com> 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, RCVD_IN_DNSWL_HI, T_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_dettach() 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..24cf4fbf92a8 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_dettach(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_dettach(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_dettach(fe->ops.analog_ops.release); } ptr = (void*)fe->ops.release; if (ptr) { fe->ops.release(fe); - symbol_put_addr(ptr); + dvb_dettach(ptr); } } #else diff --git a/drivers/media/dvb-core/dvbdev.h b/drivers/media/dvb-core/dvbdev.h index 93a9470d3f0c..49904efc476c 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_dettach(FUNC) symbol_put_addr(FUNC) + #else #define dvb_attach(FUNCTION, ARGS...) ({ \ FUNCTION(ARGS); \ }) +#define dvb_dettach(FUNC) {} + #endif #endif /* #ifndef _DVBDEV_H_ */