aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/htc_drv_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/htc_drv_init.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_init.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index a86189629d92..701f2ef5a440 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -744,6 +744,9 @@ int ath9k_htc_probe_device(struct htc_target *htc_handle, struct device *dev,
744 if (ret) 744 if (ret)
745 goto err_init; 745 goto err_init;
746 746
747 /* The device may have been unplugged earlier. */
748 priv->op_flags &= ~OP_UNPLUGGED;
749
747 ret = ath9k_init_device(priv, devid); 750 ret = ath9k_init_device(priv, devid);
748 if (ret) 751 if (ret)
749 goto err_init; 752 goto err_init;
@@ -760,6 +763,11 @@ err_free:
760void ath9k_htc_disconnect_device(struct htc_target *htc_handle, bool hotunplug) 763void ath9k_htc_disconnect_device(struct htc_target *htc_handle, bool hotunplug)
761{ 764{
762 if (htc_handle->drv_priv) { 765 if (htc_handle->drv_priv) {
766
767 /* Check if the device has been yanked out. */
768 if (hotunplug)
769 htc_handle->drv_priv->op_flags |= OP_UNPLUGGED;
770
763 ath9k_deinit_device(htc_handle->drv_priv); 771 ath9k_deinit_device(htc_handle->drv_priv);
764 ath9k_deinit_wmi(htc_handle->drv_priv); 772 ath9k_deinit_wmi(htc_handle->drv_priv);
765 ieee80211_free_hw(htc_handle->drv_priv->hw); 773 ieee80211_free_hw(htc_handle->drv_priv->hw);