|
@@ -337,6 +337,17 @@ static struct mtk_pcie_port *mtk_pcie_find_port(struct pci_bus *bus,
|
|
|
{
|
|
|
struct mtk_pcie *pcie = bus->sysdata;
|
|
|
struct mtk_pcie_port *port;
|
|
|
+ struct pci_dev *dev = NULL;
|
|
|
+
|
|
|
+ /*
|
|
|
+ * Walk the bus hierarchy to get the devfn value
|
|
|
+ * of the port in the root bus.
|
|
|
+ */
|
|
|
+ while (bus && bus->number) {
|
|
|
+ dev = bus->self;
|
|
|
+ bus = dev->bus;
|
|
|
+ devfn = dev->devfn;
|
|
|
+ }
|
|
|
|
|
|
list_for_each_entry(port, &pcie->ports, list)
|
|
|
if (port->slot == PCI_SLOT(devfn))
|