Skip to contentSkip to conversation

mt76: mt7615: rearrange cleanup operations in mt7615_unregister_device

PATCH Applied Lorenzo Bianconi 2 participants 2 messages May 5, 2019 – May 11, 2019 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Lorenzo Bianconi

author maintainer
#1 lore raw

PATCH 1/1 mt76: mt7615: rearrange cleanup operations in mt7615_unregister_device

Cleanup tx/rx napi before releasing pending idrs. Moreover unmap txwi_cache running mt76_free_device routine

---
 drivers/net/wireless/mediatek/mt76/mt7615/init.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7615/init.c +5 -4
index 3ab3ff553ef2..59f604f3161f 100644
@@ -212,6 +212,10 @@ void mt7615_unregister_device(struct mt7615_dev *dev)
 	struct mt76_txwi_cache *txwi;
 	int id;
 
+	mt76_unregister_device(&dev->mt76);
+	mt7615_dma_cleanup(dev);
+	mt7615_mcu_exit(dev);
+
 	spin_lock_bh(&dev->token_lock);
 	idr_for_each_entry(&dev->token, txwi, id) {
 		mt7615_txp_skb_unmap(&dev->mt76, txwi);
@@ -221,9 +225,6 @@ void mt7615_unregister_device(struct mt7615_dev *dev)
 	}
 	spin_unlock_bh(&dev->token_lock);
 	idr_destroy(&dev->token);
-	mt76_unregister_device(&dev->mt76);
-	mt7615_mcu_exit(dev);
-	mt7615_dma_cleanup(dev);
 
-	ieee80211_free_hw(mt76_hw(dev));
+	mt76_free_device(&dev->mt76);
 }
Signature · 1 line
2.20.1