Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1422603

[PATCH v3 5/5] staging: wilc1000: Remove semaphore close_exit_sync

From Binoy Jayan <binoy.jayan@linaro.org>
Newsgroups linux.kernel
Subject [PATCH v3 5/5] staging: wilc1000: Remove semaphore close_exit_sync
Date 2016-06-15 07:40 +0200
Message-ID <rKbIt-6OF-11@gated-at.bofh.it> (permalink)
References <rJxrH-52s-3@gated-at.bofh.it> <rKbIt-6OF-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <binoy.jayan@linaro.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
---
 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;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/7] *** staging: wilc1000: Replace semaphores with mutexes or completions *** Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-13 12:40 +0200
  [PATCH 1/7] staging: wilc1000: Replace semaphore txq_event with completion Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-13 12:40 +0200
  [PATCH 2/7] staging: wilc1000: Replace semaphore txq_add_to_head_cs with mutex Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-13 12:40 +0200
    Re: [PATCH 2/7] staging: wilc1000: Replace semaphore txq_add_to_head_cs with mutex Arnd Bergmann <arnd@arndb.de> - 2016-06-13 15:20 +0200
  [PATCH 3/7] staging: wilc1000: Replace semaphore cfg_event with completion Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-13 12:40 +0200
    Re: [PATCH 3/7] staging: wilc1000: Replace semaphore cfg_event with completion Arnd Bergmann <arnd@arndb.de> - 2016-06-13 16:30 +0200
  Re: [PATCH 0/7] *** staging: wilc1000: Replace semaphores with mutexes or completions *** Arnd Bergmann <arnd@arndb.de> - 2016-06-13 16:30 +0200
    Re: [PATCH 0/7] *** staging: wilc1000: Replace semaphores with  mutexes or completions *** Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-13 16:50 +0200
  [PATCH v2 0/5] *** staging: wilc1000: Replace semaphores with mutexes or completions *** Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-15 07:30 +0200
    [PATCH v2 1/5] staging: wilc1000: Replace semaphore txq_event with completion Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-15 07:30 +0200
  [PATCH v3 4/5] staging: wilc1000: Replace semaphore sync_event with completion Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-15 07:40 +0200
  [PATCH v3 0/5] *** staging: wilc1000: Replace semaphores with mutexes or completions *** Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-15 07:40 +0200
    [PATCH v3 5/5] staging: wilc1000: Remove semaphore close_exit_sync Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-15 07:40 +0200
    [PATCH v3 3/5] staging: wilc1000: Replace semaphore cfg_event with completion Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-15 07:40 +0200
    [PATCH v3 1/5] staging: wilc1000: Replace semaphore txq_event with completion Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-15 07:40 +0200
    [PATCH v3 2/5] staging: wilc1000: Replace semaphore txq_add_to_head_cs with mutex Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-15 07:40 +0200
  [PATCH v2 1/2] staging: wilc1000: message_queue: Move code to host interface Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-20 12:20 +0200
  [PATCH v2 0/2] *** staging: wilc1000: Replace semaphores *** Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-20 12:20 +0200
    [PATCH v2 2/2] staging: wilc1000: Replace kthread with workqueue for host interface Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-20 12:20 +0200
      Re: [PATCH v2 2/2] staging: wilc1000: Replace kthread with workqueue for host interface Arnd Bergmann <arnd@arndb.de> - 2016-06-21 18:10 +0200
    [PATCH v3 2/3] staging: wilc1000: Replace kthread with workqueue for host interface Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-22 12:10 +0200
    [PATCH v3 0/3] *** staging: wilc1000: Replace semaphores *** Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-22 12:10 +0200
      [PATCH v3 1/3] staging: wilc1000: message_queue: Move code to host interface Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-22 12:10 +0200
      [PATCH v3 3/3] staging: wilc1000: Change interface wilc_mq_send to wilc_enqueue_cmd Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-22 12:10 +0200
    [PATCH v4 2/3] staging: wilc1000: Replace kthread with workqueue for host interface Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-23 07:50 +0200
    [PATCH v4 0/3] *** staging: wilc1000: Replace semaphores *** Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-23 07:50 +0200
      [PATCH v4 3/3] staging: wilc1000: Change interface wilc_mq_send to wilc_enqueue_cmd Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-23 07:50 +0200
      [PATCH v4 1/3] staging: wilc1000: message_queue: Move code to host interface Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-23 07:50 +0200
      Re: [PATCH v4 0/3] *** staging: wilc1000: Replace semaphores *** Arnd Bergmann <arnd@arndb.de> - 2016-06-23 11:40 +0200

csiph-web