diff options
author | Xinming Hu <huxm@marvell.com> | 2016-11-30 17:52:17 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2017-01-12 17:46:23 +0300 |
commit | 045f0c1b5e26818e28a401e623a581dfbd6b371e (patch) | |
tree | bdd9da44fa6ecade8e362ceefddf8fbde60547bd /drivers/net/wireless/marvell/mwifiex/usb.c | |
parent | 90ff71f9557591218b5fce1ce7b67afd4cf83894 (diff) | |
download | linux-045f0c1b5e26818e28a401e623a581dfbd6b371e.tar.xz |
mwifiex: get rid of global user_rmmod flag
bus.remove() callback function is called when user removes this module
from kernel space or ejects the card from the slot. The driver handles
these 2 cases differently. Few commands (FUNC_SHUTDOWN etc.) are sent to
the firmware only for module unload case.
The variable 'user_rmmod' is used to distinguish between these two
scenarios.
This patch checks hardware status and get rid of global variable
user_rmmod.
Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/marvell/mwifiex/usb.c')
-rw-r--r-- | drivers/net/wireless/marvell/mwifiex/usb.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/net/wireless/marvell/mwifiex/usb.c b/drivers/net/wireless/marvell/mwifiex/usb.c index c563160b3b6b..53881c4be55d 100644 --- a/drivers/net/wireless/marvell/mwifiex/usb.c +++ b/drivers/net/wireless/marvell/mwifiex/usb.c @@ -22,7 +22,6 @@ #define USB_VERSION "1.0" -static u8 user_rmmod; static struct mwifiex_if_ops usb_ops; static struct usb_device_id mwifiex_usb_table[] = { @@ -618,7 +617,7 @@ static void mwifiex_usb_disconnect(struct usb_interface *intf) if (!adapter || !adapter->priv_num) return; - if (user_rmmod && !adapter->mfg_mode) { + if (card->udev->state != USB_STATE_NOTATTACHED && !adapter->mfg_mode) { mwifiex_deauthenticate_all(adapter); mwifiex_init_shutdown_fw(mwifiex_get_priv(adapter, @@ -1230,9 +1229,6 @@ static int mwifiex_usb_init_module(void) */ static void mwifiex_usb_cleanup_module(void) { - /* set the flag as user is removing this module */ - user_rmmod = 1; - usb_deregister(&mwifiex_usb_driver); } |