staging: wilc1000: remove function pointer wlan_cleanup
authorGlen Lee <glen.lee@atmel.com>
Thu, 1 Oct 2015 07:03:38 +0000 (16:03 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Oct 2015 09:59:52 +0000 (11:59 +0200)
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 <glen.lee@atmel.com>
Signed-off-by: Tony Cho <tony.cho@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/linux_wlan.c
drivers/staging/wilc1000/wilc_wlan.c
drivers/staging/wilc1000/wilc_wlan.h
drivers/staging/wilc1000/wilc_wlan_if.h

index e278d9408a85f2dc0bfc2e18f4ccfdde6c3fc3e2..9e222471e9164dde18a5818775b123fc40b847aa 100644 (file)
@@ -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");
index e9af7451e37ad7d031f578b65f3ecaf369e99d2f..d352f24420494f8f11e204ad1641ea6f10bf2cc9 100644 (file)
@@ -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;
index 2054ad5693e2c5f714be5ba6423c65c99cab7484..198ddb7c449a8229a347ebf02811cf6c119bb13c 100644 (file)
@@ -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
index 91bf68abf09b88bead8c81b440622ec92cd17186..624b99f09c2040736c2660aba9e5e7d57c67b543 100644 (file)
@@ -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);
This page took 0.030678 seconds and 5 git commands to generate.