diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2021-04-15 11:03:58 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2021-04-21 11:42:22 +0200 |
commit | a8333801d69d98f0b9def7c5370939100ae3160d (patch) | |
tree | 83228d397bffebd18dc017839be68c1ef578efd7 /drivers/net/wireless/mediatek/mt76/mt7921/init.c | |
parent | 495184ac91bb866ad7d794ad6ceb064e191319d4 (diff) | |
download | linux-stable-a8333801d69d98f0b9def7c5370939100ae3160d.tar.gz linux-stable-a8333801d69d98f0b9def7c5370939100ae3160d.tar.bz2 linux-stable-a8333801d69d98f0b9def7c5370939100ae3160d.zip |
mt76: mt7921: move hw configuration in mt7921_register_device
Get rid of init work since firmware loading is already performed in
mt7921_init_hardware
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt7921/init.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt7921/init.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/init.c b/drivers/net/wireless/mediatek/mt76/mt7921/init.c index 0aedddb90858..eab6e2dcdb96 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/init.c @@ -166,20 +166,10 @@ void mt7921_mac_init(struct mt7921_dev *dev) mt76_connac_mcu_set_rts_thresh(&dev->mt76, 0x92b, 0); } -static void mt7921_init_work(struct work_struct *work) -{ - struct mt7921_dev *dev = container_of(work, struct mt7921_dev, - init_work); - - mt7921_mcu_set_eeprom(dev); - mt7921_mac_init(dev); -} - static int mt7921_init_hardware(struct mt7921_dev *dev) { int ret, idx; - INIT_WORK(&dev->init_work, mt7921_init_work); spin_lock_init(&dev->token_lock); idr_init(&dev->token); @@ -202,6 +192,10 @@ static int mt7921_init_hardware(struct mt7921_dev *dev) if (ret < 0) return ret; + ret = mt7921_mcu_set_eeprom(dev); + if (ret) + return ret; + /* Beacon and mgmt frames should occupy wcid 0 */ idx = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7921_WTBL_STA - 1); if (idx) @@ -212,6 +206,8 @@ static int mt7921_init_hardware(struct mt7921_dev *dev) dev->mt76.global_wcid.tx_info |= MT_WCID_TX_INFO_SET; rcu_assign_pointer(dev->mt76.wcid[idx], &dev->mt76.global_wcid); + mt7921_mac_init(dev); + return 0; } @@ -266,8 +262,6 @@ int mt7921_register_device(struct mt7921_dev *dev) if (ret) return ret; - ieee80211_queue_work(mt76_hw(dev), &dev->init_work); - return mt7921_init_debugfs(dev); } |