mt76x0: move stop related routines in mt76x0_mac_stop
authorLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Thu, 6 Sep 2018 09:18:48 +0000 (11:18 +0200)
committerFelix Fietkau <nbd@nbd.name>
Wed, 19 Sep 2018 10:31:05 +0000 (12:31 +0200)
Move tear-down routines in mt76x0_mac_stop function.
mt76x0_mac_stop routines will be reused in mt76x0_suspend

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt76x0/init.c
drivers/net/wireless/mediatek/mt76/mt76x0/main.c

index d186f50..b1d5f64 100644 (file)
@@ -361,6 +361,9 @@ static void mt76x0_mac_stop_hw(struct mt76x0_dev *dev)
 
 void mt76x0_mac_stop(struct mt76x0_dev *dev)
 {
+       cancel_delayed_work_sync(&dev->cal_work);
+       cancel_delayed_work_sync(&dev->mac_work);
+       mt76u_stop_stat_wk(&dev->mt76);
        mt76x0_mac_stop_hw(dev);
 }
 
index 8c8a0f6..0d3c7ac 100644 (file)
@@ -48,10 +48,6 @@ static void mt76x0_stop(struct ieee80211_hw *hw)
        mutex_lock(&dev->mt76.mutex);
 
        clear_bit(MT76_STATE_RUNNING, &dev->mt76.state);
-
-       cancel_delayed_work_sync(&dev->cal_work);
-       cancel_delayed_work_sync(&dev->mac_work);
-       mt76u_stop_stat_wk(&dev->mt76);
        mt76x0_mac_stop(dev);
 
        mutex_unlock(&dev->mt76.mutex);