From 90b984c8558ba6af99ca32931be5c1bb21c34271 Mon Sep 17 00:00:00 2001 From: Glen Lee Date: Thu, 29 Oct 2015 12:18:50 +0900 Subject: [PATCH] staging: wilc1000: wl_wlan_cleanup: add argument struct wilc This patch adds new argument struct wilc and use it instead of g_linux_wlan. Signed-off-by: Glen Lee Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wilc1000/linux_wlan.c | 28 +++++++++---------- drivers/staging/wilc1000/linux_wlan_sdio.c | 2 +- drivers/staging/wilc1000/wilc_wfi_netdevice.h | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 2103e8c0d6f9..09ddba2fb53a 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -1651,39 +1651,39 @@ void WILC_WFI_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size) WILC_WFI_p2p_rx(wilc->vif[1].ndev, buff, size); } -void wl_wlan_cleanup(void) +void wl_wlan_cleanup(struct wilc *wilc) { int i = 0; perInterface_wlan_t *nic[NUM_CONCURRENT_IFC]; - if (g_linux_wlan && - (g_linux_wlan->vif[0].ndev || g_linux_wlan->vif[1].ndev)) { + if (wilc && + (wilc->vif[0].ndev || wilc->vif[1].ndev)) { unregister_inetaddr_notifier(&g_dev_notifier); for (i = 0; i < NUM_CONCURRENT_IFC; i++) - nic[i] = netdev_priv(g_linux_wlan->vif[i].ndev); + nic[i] = netdev_priv(wilc->vif[i].ndev); } - if (g_linux_wlan && g_linux_wlan->firmware) - release_firmware(g_linux_wlan->firmware); + if (wilc && wilc->firmware) + release_firmware(wilc->firmware); - if (g_linux_wlan && - (g_linux_wlan->vif[0].ndev || g_linux_wlan->vif[1].ndev)) { + if (wilc&& + (wilc->vif[0].ndev || wilc->vif[1].ndev)) { linux_wlan_lock_timeout(&close_exit_sync, 12 * 1000); for (i = 0; i < NUM_CONCURRENT_IFC; i++) - if (g_linux_wlan->vif[i].ndev) + if (wilc->vif[i].ndev) if (nic[i]->mac_opened) - mac_close(g_linux_wlan->vif[i].ndev); + mac_close(wilc->vif[i].ndev); for (i = 0; i < NUM_CONCURRENT_IFC; i++) { - unregister_netdev(g_linux_wlan->vif[i].ndev); - wilc_free_wiphy(g_linux_wlan->vif[i].ndev); - free_netdev(g_linux_wlan->vif[i].ndev); + unregister_netdev(wilc->vif[i].ndev); + wilc_free_wiphy(wilc->vif[i].ndev); + free_netdev(wilc->vif[i].ndev); } } - kfree(g_linux_wlan); + kfree(wilc); #if defined(WILC_DEBUGFS) wilc_debugfs_remove(); diff --git a/drivers/staging/wilc1000/linux_wlan_sdio.c b/drivers/staging/wilc1000/linux_wlan_sdio.c index 4aff953a88f1..bf05e227778c 100644 --- a/drivers/staging/wilc1000/linux_wlan_sdio.c +++ b/drivers/staging/wilc1000/linux_wlan_sdio.c @@ -146,7 +146,7 @@ static void linux_sdio_remove(struct sdio_func *func) struct wilc_sdio *wl_sdio; wl_sdio = sdio_get_drvdata(func); - wl_wlan_cleanup(); + wl_wlan_cleanup(wl_sdio->wilc); kfree(wl_sdio); } diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h index 0435cb571227..07917ea105b6 100644 --- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h +++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h @@ -213,7 +213,7 @@ void linux_wlan_mac_indicate(struct wilc *wilc, int flag); void linux_wlan_rx_complete(void); void linux_wlan_dbg(u8 *buff); int linux_wlan_lock_timeout(void *vp, u32 timeout); -void wl_wlan_cleanup(void); +void wl_wlan_cleanup(struct wilc *wilc); int wilc_netdev_init(struct wilc **wilc); void wilc1000_wlan_deinit(struct net_device *dev); void WILC_WFI_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size); -- 2.39.5