staging: wilc1000: wilc_wlan_cfg_get: pass struct wilc
authorGlen Lee <glen.lee@atmel.com>
Wed, 18 Nov 2015 06:11:35 +0000 (15:11 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Dec 2015 22:30:50 +0000 (14:30 -0800)
This patch passes the struct wilc to the function and use it instead of
global variable wilc_dev.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/coreconfigurator.c
drivers/staging/wilc1000/linux_wlan.c
drivers/staging/wilc1000/wilc_wlan.c
drivers/staging/wilc1000/wilc_wlan.h

index 6278aecba2f79bd57d61925eb68ab8ed6c17f26f..0cd2accf1a348ad5a572b3239f1b13387f6cbb83 100644 (file)
@@ -597,7 +597,7 @@ s32 wilc_send_config_pkt(struct wilc *wilc, u8 mode, struct wid *wids,
                for (counter = 0; counter < count; counter++) {
                        PRINT_INFO(CORECONFIG_DBG, "Sending CFG packet [%d][%d]\n", !counter,
                                   (counter == count - 1));
-                       if (!wilc_wlan_cfg_get(!counter,
+                       if (!wilc_wlan_cfg_get(wilc, !counter,
                                               wids[counter].id,
                                               (counter == count - 1),
                                               drv)) {
index 792cc0be5a63509d9887e055bc051cf5390307d5..1457e755dc49be9b2c44415fd5ce12e1a93be430 100644 (file)
@@ -939,7 +939,7 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic)
                        goto _fail_irq_enable_;
                }
 
-               if (wilc_wlan_cfg_get(1, WID_FIRMWARE_VERSION, 1, 0)) {
+               if (wilc_wlan_cfg_get(wl, 1, WID_FIRMWARE_VERSION, 1, 0)) {
                        int size;
                        char Firmware_ver[20];
 
index 03c707b6488f82d5b7fc006bd27f8db0c539d370..a27185115e49b88cce9bbca8fe45a36d56a62b23 100644 (file)
@@ -1540,10 +1540,10 @@ int wilc_wlan_cfg_set(struct wilc *wilc, int start, u32 wid, u8 *buffer,
        return ret_size;
 }
 
-int wilc_wlan_cfg_get(int start, u32 wid, int commit, u32 drv_handler)
+int wilc_wlan_cfg_get(struct wilc *wilc, int start, u32 wid, int commit,
+                     u32 drv_handler)
 {
        wilc_wlan_dev_t *p = &g_wlan;
-       struct wilc *wilc = wilc_dev;
        u32 offset;
        int ret_size;
 
index e1a8c730831c99f5307f1a549b9899a95bc5ae16..2ac63a3e092a1414fe77f7d35c060ae88a722ac3 100644 (file)
@@ -291,7 +291,8 @@ void wilc_handle_isr(struct wilc *wilc);
 void wilc_wlan_cleanup(struct net_device *dev);
 int wilc_wlan_cfg_set(struct wilc *wilc, int start, u32 wid, u8 *buffer,
                      u32 buffer_size, int commit, u32 drv_handler);
-int wilc_wlan_cfg_get(int start, u32 wid, int commit, u32 drv_handler);
+int wilc_wlan_cfg_get(struct wilc *wilc, int start, u32 wid, int commit,
+                     u32 drv_handler);
 int wilc_wlan_cfg_get_val(u32 wid, u8 *buffer, u32 buffer_size);
 int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer,
                               u32 buffer_size, wilc_tx_complete_func_t func);