Search Linux Wireless

[PATCH 2/5] mt76: mt7921: move fw toggle in mt7921_load_firmware

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Move drv_own/fw_own toggle in mt7921_load_firmware. This change allow to
reuse connac code to load patch for mt7921 driver.

Signed-off-by: Lorenzo Bianconi <lorenzo@xxxxxxxxxx>
---
 drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
index 1f1c270a4d81..bf1648b02ab5 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
@@ -537,13 +537,6 @@ static int mt7921_load_patch(struct mt7921_dev *dev)
 		break;
 	}
 
-	if (!ret && mt76_is_sdio(&dev->mt76)) {
-		/* activate again */
-		ret = __mt7921_mcu_fw_pmctrl(dev);
-		if (!ret)
-			ret = __mt7921_mcu_drv_pmctrl(dev);
-	}
-
 	release_firmware(fw);
 
 	return ret;
@@ -662,6 +655,13 @@ static int mt7921_load_firmware(struct mt7921_dev *dev)
 	if (ret)
 		return ret;
 
+	if (mt76_is_sdio(&dev->mt76)) {
+		/* activate again */
+		ret = __mt7921_mcu_fw_pmctrl(dev);
+		if (!ret)
+			ret = __mt7921_mcu_drv_pmctrl(dev);
+	}
+
 	ret = mt7921_load_ram(dev);
 	if (ret)
 		return ret;
-- 
2.35.3




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux