From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 7313D1C0FC3 for ; Wed, 18 Nov 2015 12:44:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 6F74C940F4 for ; Wed, 18 Nov 2015 12:44:48 +0000 (UTC) Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uTF4obL8CDSh for ; Wed, 18 Nov 2015 12:44:47 +0000 (UTC) Received: from email.microchip.com (exsmtp01.microchip.com [198.175.253.37]) by hemlock.osuosl.org (Postfix) with ESMTPS id 88A4E94057 for ; Wed, 18 Nov 2015 12:44:47 +0000 (UTC) From: Christian Gromm Subject: [PATCH 16/28] staging: most: remove reference counter Date: Wed, 18 Nov 2015 13:43:40 +0100 Message-ID: <1447850632-16782-17-git-send-email-christian.gromm@microchip.com> In-Reply-To: <1447850632-16782-1-git-send-email-christian.gromm@microchip.com> References: <1447850632-16782-1-git-send-email-christian.gromm@microchip.com> MIME-Version: 1.0 List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: gregkh@linuxfoundation.org Cc: Christian Gromm , driverdev-devel@linuxdriverproject.org This patch removes the unnecessary reference conter mod_ref. Signed-off-by: Christian Gromm --- drivers/staging/most/mostcore/core.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c index 58e288b..daae42d 100644 --- a/drivers/staging/most/mostcore/core.c +++ b/drivers/staging/most/mostcore/core.c @@ -35,7 +35,6 @@ static struct class *most_class; static struct device *class_glue_dir; static struct ida mdev_id; -static int modref; static int dummy_num_buffers; struct most_c_aim_obj { @@ -1508,7 +1507,6 @@ int most_start_channel(struct most_interface *iface, int id, mutex_unlock(&c->start_mutex); return -ENOLCK; } - modref++; c->cfg.extra_len = 0; if (c->iface->configure(c->iface, c->channel_id, &c->cfg)) { @@ -1550,7 +1548,6 @@ out: error: module_put(iface->mod); - modref--; mutex_unlock(&c->start_mutex); return ret; } @@ -1584,10 +1581,8 @@ int most_stop_channel(struct most_interface *iface, int id, c->hdm_enqueue_task = NULL; mutex_unlock(&c->stop_task_mutex); - if (iface->mod && modref) { + if (iface->mod) module_put(iface->mod); - modref--; - } c->is_poisoned = true; if (c->iface->poison_channel(c->iface, c->channel_id)) { @@ -1808,12 +1803,6 @@ void most_deregister_interface(struct most_interface *iface) c->aim1.ptr = NULL; } - while (modref) { - if (iface->mod && modref) - module_put(iface->mod); - modref--; - } - list_for_each_entry(c, &i->channel_list, list) { if (c->aim0.refs + c->aim1.refs <= 0) continue; -- 1.7.9.5 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel