diff --git a/mt7915/pci.c b/mt7915/pci.c index 251856c4..b0e8e83c 100644 --- a/mt7915/pci.c +++ b/mt7915/pci.c @@ -158,6 +158,12 @@ static void mt7915_pci_init_hif2(struct mt7915_dev *dev) { struct mt7915_hif *hif; + dev->hif_idx = ++hif_idx; + if (!pci_get_device(PCI_VENDOR_ID_MEDIATEK, 0x7916, NULL)) + return; + + mt76_wr(dev, MT_PCIE_RECOG_ID, dev->hif_idx | MT_PCIE_RECOG_ID_SEM); + hif = mt7915_pci_get_hif2(dev); if (!hif) return; @@ -258,9 +264,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);