diff options
| -rw-r--r-- | drivers/net/wireless/mac80211_hwsim.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 23fa6ee8eefe..cca5b3ffb22c 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c | |||
| @@ -1623,25 +1623,29 @@ static const struct ieee80211_ops mac80211_hwsim_ops = { | |||
| 1623 | 1623 | ||
| 1624 | static struct ieee80211_ops mac80211_hwsim_mchan_ops; | 1624 | static struct ieee80211_ops mac80211_hwsim_mchan_ops; |
| 1625 | 1625 | ||
| 1626 | static void mac80211_hwsim_free(void) | 1626 | static void mac80211_hwsim_destroy_radio(struct mac80211_hwsim_data *data) |
| 1627 | { | 1627 | { |
| 1628 | struct list_head tmplist, *i, *tmp; | 1628 | debugfs_remove_recursive(data->debugfs); |
| 1629 | struct mac80211_hwsim_data *data, *tmpdata; | 1629 | ieee80211_unregister_hw(data->hw); |
| 1630 | device_release_driver(data->dev); | ||
| 1631 | device_unregister(data->dev); | ||
| 1632 | ieee80211_free_hw(data->hw); | ||
| 1633 | } | ||
| 1630 | 1634 | ||
| 1631 | INIT_LIST_HEAD(&tmplist); | 1635 | static void mac80211_hwsim_free(void) |
| 1636 | { | ||
| 1637 | struct mac80211_hwsim_data *data; | ||
| 1632 | 1638 | ||
| 1633 | spin_lock_bh(&hwsim_radio_lock); | 1639 | spin_lock_bh(&hwsim_radio_lock); |
| 1634 | list_for_each_safe(i, tmp, &hwsim_radios) | 1640 | while ((data = list_first_entry_or_null(&hwsim_radios, |
| 1635 | list_move(i, &tmplist); | 1641 | struct mac80211_hwsim_data, |
| 1636 | spin_unlock_bh(&hwsim_radio_lock); | 1642 | list))) { |
| 1637 | 1643 | list_del(&data->list); | |
| 1638 | list_for_each_entry_safe(data, tmpdata, &tmplist, list) { | 1644 | spin_unlock_bh(&hwsim_radio_lock); |
| 1639 | debugfs_remove_recursive(data->debugfs); | 1645 | mac80211_hwsim_destroy_radio(data); |
| 1640 | ieee80211_unregister_hw(data->hw); | 1646 | spin_lock_bh(&hwsim_radio_lock); |
| 1641 | device_release_driver(data->dev); | ||
| 1642 | device_unregister(data->dev); | ||
| 1643 | ieee80211_free_hw(data->hw); | ||
| 1644 | } | 1647 | } |
| 1648 | spin_unlock_bh(&hwsim_radio_lock); | ||
| 1645 | class_destroy(hwsim_class); | 1649 | class_destroy(hwsim_class); |
| 1646 | } | 1650 | } |
| 1647 | 1651 | ||
