diff mbox series

mt76: mt7915: only set PCIE_RECOGNITION_ID when using the second hif

Message ID 121208af32ad8850fe04feb6707f3fe2304d8353.1611720332.git.ryder.lee@mediatek.com (mailing list archive)
State New, archived
Headers show
Series mt76: mt7915: only set PCIE_RECOGNITION_ID when using the second hif | expand

Commit Message

Ryder Lee Jan. 27, 2021, 4:10 a.m. UTC
To avoid connection issue on mt7622.

Signed-off-by: Zhiqiang Yang <zhiqiang.yang@mediatek.com>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
---
 drivers/net/wireless/mediatek/mt76/mt7915/pci.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/pci.c b/drivers/net/wireless/mediatek/mt76/mt7915/pci.c
index 64ffffdc93c9..2cb7a6ff0ffd 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/pci.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/pci.c
@@ -183,6 +183,8 @@  static void mt7915_pci_init_hif2(struct mt7915_dev *dev)
 		return;
 
 	dev->hif2 = hif;
+	dev->hif_idx = ++hif_idx;
+	mt76_wr(dev, MT_PCIE_RECOG_ID, dev->hif_idx | MT_PCIE_RECOG_ID_SEM);
 
 	if (devm_request_irq(dev->mt76.dev, hif->irq, mt7915_irq_handler,
 			     IRQF_SHARED, KBUILD_MODNAME "-hif", dev)) {
@@ -280,9 +282,6 @@  static int mt7915_pci_probe(struct pci_dev *pdev,
 	if (ret)
 		goto error;
 
-	dev->hif_idx = ++hif_idx;
-	mt76_wr(dev, MT_PCIE_RECOG_ID, dev->hif_idx | MT_PCIE_RECOG_ID_SEM);
-
 	mt7915_pci_init_hif2(dev);
 
 	ret = mt7915_register_device(dev);