summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlen Lee <glen.lee@atmel.com>2015-10-20 08:13:55 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-25 01:16:57 (GMT)
commitca64ad6e6436ed69aa6b79eaf39ff833986bcea8 (patch)
tree1779f4e0b2ea41e978ea5f906638854e834dc379
parentf3c1366ebbdf54e85810951e8efc9fcf9e430b99 (diff)
downloadlinux-ca64ad6e6436ed69aa6b79eaf39ff833986bcea8.tar.xz
staging: wilc1000: mac_close: use netdev private wilc instead of g_linux_wlan
Use netdev private data member wilc instead of global variable g_linux_wlan. 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>
-rw-r--r--drivers/staging/wilc1000/linux_wlan.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index ebedffa..93475aa 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1383,6 +1383,7 @@ int mac_close(struct net_device *ndev)
struct wilc_priv *priv;
perInterface_wlan_t *nic;
struct host_if_drv *pstrWFIDrv;
+ struct wilc *wl;
nic = netdev_priv(ndev);
@@ -1392,6 +1393,7 @@ int mac_close(struct net_device *ndev)
}
priv = wiphy_priv(nic->wilc_netdev->ieee80211_ptr->wiphy);
+ wl = nic->wilc;
if (priv == NULL) {
PRINT_ER("priv = NULL\n");
@@ -1402,8 +1404,8 @@ int mac_close(struct net_device *ndev)
PRINT_D(GENERIC_DBG, "Mac close\n");
- if (g_linux_wlan == NULL) {
- PRINT_ER("g_linux_wlan = NULL\n");
+ if (!wl) {
+ PRINT_ER("wl = NULL\n");
return 0;
}
@@ -1412,8 +1414,8 @@ int mac_close(struct net_device *ndev)
return 0;
}
- if ((g_linux_wlan->open_ifcs) > 0) {
- g_linux_wlan->open_ifcs--;
+ if ((wl->open_ifcs) > 0) {
+ wl->open_ifcs--;
} else {
PRINT_ER("ERROR: MAC close called while number of opened interfaces is zero\n");
return 0;
@@ -1426,10 +1428,10 @@ int mac_close(struct net_device *ndev)
wilc_deinit_host_int(nic->wilc_netdev);
}
- if (g_linux_wlan->open_ifcs == 0) {
+ if (wl->open_ifcs == 0) {
PRINT_D(GENERIC_DBG, "Deinitializing wilc1000\n");
- g_linux_wlan->close = 1;
- wilc1000_wlan_deinit(g_linux_wlan);
+ wl->close = 1;
+ wilc1000_wlan_deinit(wl);
WILC_WFI_deinit_mon_interface();
}