From patchwork Wed Jun 15 05:30:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Binoy Jayan X-Patchwork-Id: 9177545 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 852EE6021C for ; Wed, 15 Jun 2016 05:31:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 74B2A2835B for ; Wed, 15 Jun 2016 05:31:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 687BD2835F; Wed, 15 Jun 2016 05:31:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D64F2835B for ; Wed, 15 Jun 2016 05:31:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752926AbcFOFbP (ORCPT ); Wed, 15 Jun 2016 01:31:15 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:36623 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752908AbcFOFbN (ORCPT ); Wed, 15 Jun 2016 01:31:13 -0400 Received: by mail-pa0-f45.google.com with SMTP id b5so3922621pas.3 for ; Tue, 14 Jun 2016 22:31:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4bngoHov1ZcMRRMrEfSPZkjumP8fbmkCjBrufsshSRU=; b=TUwdSZBiilbCgDfaftctq9eoWVQKFgYXcbdeVUanIzQE4Rz93T2UC3eVEP2+5l6Lu2 xAIhteU/3TY6R/PvT51K8nsZXHo54JLvmmnNNit5XZV5FY54tde3t4ugB2jbl8aqpDJ4 c3399PbAk/qm+QW6UlaTc2m+xGt6rLTM/ieWg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4bngoHov1ZcMRRMrEfSPZkjumP8fbmkCjBrufsshSRU=; b=P/x/dUIB/KhmyDnCickxAQm8fQ64Az8jP4qQAfREJVpo0l+5NiWjgrJdOX2/Ho2wFd TM3BCSZ+cUZLqvEGWD7jrKCG+I88zPp6+7yDuP+DGtOh1UhjhwwlyalETWMQfGj3Acuf 0rJ7wN3rf555csEJHj5oQ7rHMj3nG6uIMPiUX7HhfBx69tfOcuujwyqaFS1ORXuc/iuB Y02C1iVMCH6c0g32tJeBGL9tr8Da93V0SMElEGJk2Lo52WgpswWFTSOblXrA1YO+vmv+ +7Bae078CSlPwXxvnVdgfjsECbZRIytuu3F6n4jIiOZWgKl7F6vWxth7eiihKWEKD5ki zqcg== X-Gm-Message-State: ALyK8tJzrh0V2y+vF9N1ZnDLOb0NMfjvhY6qf9hRGJVqYLyXhrsviSYWqivdvU5Ys9duKUvJ X-Received: by 10.67.7.199 with SMTP id de7mr1841466pad.94.1465968672931; Tue, 14 Jun 2016 22:31:12 -0700 (PDT) Received: from blr-ubuntu-59.ap.qualcomm.com ([202.46.23.61]) by smtp.gmail.com with ESMTPSA id 81sm28286566pfo.74.2016.06.14.22.31.08 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 14 Jun 2016 22:31:12 -0700 (PDT) From: Binoy Jayan To: Greg Kroah-Hartman Cc: Johnny Kim , Austin Shin , Chris Park , Tony Cho , Glen Lee , Leo Kim , Arnd Bergmann , linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Binoy Jayan Subject: [PATCH v3 5/5] staging: wilc1000: Remove semaphore close_exit_sync Date: Wed, 15 Jun 2016 11:00:38 +0530 Message-Id: <1465968638-22129-6-git-send-email-binoy.jayan@linaro.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1465968638-22129-1-git-send-email-binoy.jayan@linaro.org> References: <1465814259-3009-1-git-send-email-binoy.jayan@linaro.org> <1465968638-22129-1-git-send-email-binoy.jayan@linaro.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The semaphore 'close_exit_sync' does not serve any purpose other than delaying the deregistration of the device which it is trying to protect from shared access. 'up' is called only when a subdevice is closed and not when it is opened. So, the semaphore count only goes up when the device is used. Signed-off-by: Binoy Jayan Reviewed-by: Arnd Bergmann --- drivers/staging/wilc1000/linux_wlan.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 39fe350..f87a30f 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -31,8 +31,6 @@ static struct notifier_block g_dev_notifier = { .notifier_call = dev_state_ev_handler }; -static struct semaphore close_exit_sync; - static int wlan_deinit_locks(struct net_device *dev); static void wlan_deinitialize_threads(struct net_device *dev); @@ -1088,7 +1086,6 @@ int wilc_mac_close(struct net_device *ndev) WILC_WFI_deinit_mon_interface(); } - up(&close_exit_sync); vif->mac_opened = 0; return 0; @@ -1232,8 +1229,6 @@ void wilc_netdev_cleanup(struct wilc *wilc) } if (wilc && (wilc->vif[0]->ndev || wilc->vif[1]->ndev)) { - wilc_lock_timeout(wilc, &close_exit_sync, 5 * 1000); - for (i = 0; i < NUM_CONCURRENT_IFC; i++) if (wilc->vif[i]->ndev) if (vif[i]->mac_opened) @@ -1258,8 +1253,6 @@ int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type, struct net_device *ndev; struct wilc *wl; - sema_init(&close_exit_sync, 0); - wl = kzalloc(sizeof(*wl), GFP_KERNEL); if (!wl) return -ENOMEM;