From patchwork Thu Oct 1 07:03:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Cho X-Patchwork-Id: 7305411 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EEC6F9F314 for ; Thu, 1 Oct 2015 07:04:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F3B7B207F0 for ; Thu, 1 Oct 2015 07:04:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EC33D20687 for ; Thu, 1 Oct 2015 07:04:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755425AbbJAHEl (ORCPT ); Thu, 1 Oct 2015 03:04:41 -0400 Received: from eusmtp01.atmel.com ([212.144.249.242]:3515 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754388AbbJAHEj (ORCPT ); Thu, 1 Oct 2015 03:04:39 -0400 Received: from tony-itx.corp.atmel.com (10.161.101.13) by eusmtp01.atmel.com (10.161.101.30) with Microsoft SMTP Server id 14.3.235.1; Thu, 1 Oct 2015 09:04:33 +0200 From: Tony Cho To: CC: , , , , , , , , , , , Subject: [PATCH 07/12] staging: wilc1000: remove function pointer wlan_cleanup Date: Thu, 1 Oct 2015 16:03:38 +0900 Message-ID: <1443683023-6498-7-git-send-email-tony.cho@atmel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1443683023-6498-1-git-send-email-tony.cho@atmel.com> References: <1443683023-6498-1-git-send-email-tony.cho@atmel.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@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=unavailable 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 From: Glen Lee This patch removes function pointer wlan_cleanup and just call the function wilc_wlan_cleanup. Remove static from the function also. After changing function pointer wlan_cleanup with wilc_wlan_cleanup, the define wilc_wlan_deinit will be like folowing. -define wilc_wlan_deinit(nic) { wilc_wlan_cleanup(); } The define is unnecessary so just call wilc_wlan_cleanup instead of wilc_wlan_deinit() and remove the define also. Signed-off-by: Glen Lee Signed-off-by: Tony Cho --- drivers/staging/wilc1000/linux_wlan.c | 10 +++------- drivers/staging/wilc1000/wilc_wlan.c | 3 +-- drivers/staging/wilc1000/wilc_wlan.h | 1 + drivers/staging/wilc1000/wilc_wlan_if.h | 1 - 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index e278d94..9e22247 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -86,10 +86,6 @@ static struct notifier_block g_dev_notifier = { .notifier_call = dev_state_ev_handler }; -#define wilc_wlan_deinit(nic) { if (&g_linux_wlan->oup != NULL) \ - if (g_linux_wlan->oup.wlan_cleanup != NULL) \ - g_linux_wlan->oup.wlan_cleanup(); } - #define IRQ_WAIT 1 #define IRQ_NO_WAIT 0 /* @@ -983,7 +979,7 @@ void wilc1000_wlan_deinit(linux_wlan_t *nic) wilc_wlan_stop(); PRINT_D(INIT_DBG, "Deinitializing WILC Wlan\n"); - wilc_wlan_deinit(nic); + wilc_wlan_cleanup(); #if (defined WILC_SDIO) && (!defined WILC_SDIO_IRQ_GPIO) #if defined(PLAT_ALLWINNER_A20) || defined(PLAT_ALLWINNER_A23) || defined(PLAT_ALLWINNER_A31) PRINT_D(INIT_DBG, "Disabling IRQ 2\n"); @@ -1132,7 +1128,7 @@ u8 wilc1000_prepare_11b_core(wilc_wlan_inp_t *nwi, wilc_wlan_oup_t *nwo, linux_w while ((core_11b_ready() && (READY_CHECK_THRESHOLD > (trials++)))) { PRINT_D(INIT_DBG, "11b core not ready yet: %u\n", trials); - wilc_wlan_deinit(nic); + wilc_wlan_cleanup(); wilc_wlan_global_reset(); sdio_unregister_driver(&wilc_bus); @@ -1330,7 +1326,7 @@ _fail_irq_init_: _fail_threads_: wlan_deinitialize_threads(g_linux_wlan); _fail_wilc_wlan_: - wilc_wlan_deinit(g_linux_wlan); + wilc_wlan_cleanup(); _fail_locks_: wlan_deinit_locks(g_linux_wlan); PRINT_ER("WLAN Iinitialization FAILED\n"); diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index e9af745..d352f24 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -1652,7 +1652,7 @@ int wilc_wlan_stop(void) return ret; } -static void wilc_wlan_cleanup(void) +void wilc_wlan_cleanup(void) { wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan; struct txq_entry_t *tqe; @@ -2028,7 +2028,6 @@ int wilc_wlan_init(wilc_wlan_inp_t *inp, wilc_wlan_oup_t *oup) /** * export functions **/ - oup->wlan_cleanup = wilc_wlan_cleanup; oup->wlan_cfg_set = wilc_wlan_cfg_set; oup->wlan_cfg_get = wilc_wlan_cfg_get; oup->wlan_cfg_get_value = wilc_wlan_cfg_get_val; diff --git a/drivers/staging/wilc1000/wilc_wlan.h b/drivers/staging/wilc1000/wilc_wlan.h index 2054ad5..198ddb7 100644 --- a/drivers/staging/wilc1000/wilc_wlan.h +++ b/drivers/staging/wilc1000/wilc_wlan.h @@ -312,4 +312,5 @@ int wilc_wlan_txq_add_net_pkt(void *priv, u8 *buffer, u32 buffer_size, wilc_tx_complete_func_t func); int wilc_wlan_handle_txq(u32 *pu32TxqCount); void wilc_handle_isr(void); +void wilc_wlan_cleanup(void); #endif diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h index 91bf68a..624b99f 100644 --- a/drivers/staging/wilc1000/wilc_wlan_if.h +++ b/drivers/staging/wilc1000/wilc_wlan_if.h @@ -122,7 +122,6 @@ typedef void (*wilc_tx_complete_func_t)(void *, int); #define WILC_TX_ERR_NO_BUF (-2) typedef struct { - void (*wlan_cleanup)(void); int (*wlan_cfg_set)(int, u32, u8 *, u32, int, u32); int (*wlan_cfg_get)(int, u32, int, u32); int (*wlan_cfg_get_value)(u32, u8 *, u32);