mt76: mt7915: avoid writes to MT_PCIE_RECOG_ID when not using gen1 devices

Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Felix Fietkau
2021-01-26 19:33:34 +01:00
parent 0714890bf0
commit 2f85aa5cbc
+6 -3
View File
@@ -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);