diff mbox

[08/12] staging: wilc1000: remove used functions

Message ID 1450072023-13013-9-git-send-email-glen.lee@atmel.com (mailing list archive)
State Not Applicable
Delegated to: Kalle Valo
Headers show

Commit Message

Glen Lee Dec. 14, 2015, 5:46 a.m. UTC
This patch remove unused functions add_handler_in_list and
remove_handler_in_list, and it's related global variable wfidrv_list and codes.
label fail_timer_2 and it's codes are removed since label is not used anymore.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
---
 drivers/staging/wilc1000/host_interface.c | 44 -------------------------------
 1 file changed, 44 deletions(-)
diff mbox

Patch

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 76e891c..5bf2a47 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -226,7 +226,6 @@  struct join_bss_param {
 	u8 start_time[4];
 };
 
-static struct host_if_drv *wfidrv_list[NUM_CONCURRENT_IFC + 1];
 struct host_if_drv *terminated_handle;
 bool wilc_optaining_ip;
 static u8 P2P_LISTEN_STATE;
@@ -266,34 +265,6 @@  static struct wilc_vif *join_req_vif;
 
 static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo);
 
-static int add_handler_in_list(struct host_if_drv *handler)
-{
-	int i;
-
-	for (i = 1; i < ARRAY_SIZE(wfidrv_list); i++) {
-		if (!wfidrv_list[i]) {
-			wfidrv_list[i] = handler;
-			return 0;
-		}
-	}
-
-	return -ENOBUFS;
-}
-
-static int remove_handler_in_list(struct host_if_drv *handler)
-{
-	int i;
-
-	for (i = 1; i < ARRAY_SIZE(wfidrv_list); i++) {
-		if (wfidrv_list[i] == handler) {
-			wfidrv_list[i] = NULL;
-			return 0;
-		}
-	}
-
-	return -EINVAL;
-}
-
 /* The u8IfIdx starts from 0 to NUM_CONCURRENT_IFC -1, but 0 index used as
  * special purpose in wilc device, so we add 1 to the index to starts from 1.
  * As a result, the returned index will be 1 to NUM_CONCURRENT_IFC.
@@ -3845,7 +3816,6 @@  s32 wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
 {
 	s32 result = 0;
 	struct host_if_drv *hif_drv;
-	int err;
 	struct wilc_vif *vif;
 	struct wilc *wilc;
 
@@ -3865,11 +3835,6 @@  s32 wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
 	}
 	hif_drv->wilc = wilc;
 	*hif_drv_handler = hif_drv;
-	err = add_handler_in_list(hif_drv);
-	if (err) {
-		result = -EFAULT;
-		goto _fail_timer_2;
-	}
 
 	wilc_optaining_ip = false;
 
@@ -3939,10 +3904,6 @@  s32 wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
 
 	return result;
 
-_fail_timer_2:
-	del_timer_sync(&hif_drv->connect_timer);
-	del_timer_sync(&hif_drv->scan_timer);
-	kthread_stop(hif_thread_handler);
 _fail_mq_:
 	wilc_mq_destroy(&hif_msg_q);
 _fail_:
@@ -3954,7 +3915,6 @@  s32 wilc_deinit(struct wilc_vif *vif)
 	s32 result = 0;
 	struct host_if_msg msg;
 	struct host_if_drv *hif_drv = vif->hif_drv;
-	int ret;
 
 	if (!hif_drv)	{
 		PRINT_ER("hif_drv = NULL\n");
@@ -4009,10 +3969,6 @@  s32 wilc_deinit(struct wilc_vif *vif)
 		wilc_mq_destroy(&hif_msg_q);
 	}
 
-	ret = remove_handler_in_list(hif_drv);
-	if (ret)
-		result = -ENOENT;
-
 	kfree(hif_drv);
 
 	clients_count--;