Commit 36dea02f authored by Dan Carpenter's avatar Dan Carpenter Committed by Kamal Mostafa

PCI: cpcihp: Add missing curly braces in cpci_configure_slot()

commit bc3b5b47 upstream.

I don't have this hardware but it looks like we weren't adding bridge
devices as intended.  Maybe the bridge is always the last device?

Fixes: 05b12500 ("PCI: cpcihp: Iterate over all devices in slot, not functions 0-7")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Acked-by: default avatarYijing Wang <wangyijing@huawei.com>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent 54695743
...@@ -282,12 +282,13 @@ int __ref cpci_configure_slot(struct slot *slot) ...@@ -282,12 +282,13 @@ int __ref cpci_configure_slot(struct slot *slot)
} }
parent = slot->dev->bus; parent = slot->dev->bus;
list_for_each_entry(dev, &parent->devices, bus_list) list_for_each_entry(dev, &parent->devices, bus_list) {
if (PCI_SLOT(dev->devfn) != PCI_SLOT(slot->devfn)) if (PCI_SLOT(dev->devfn) != PCI_SLOT(slot->devfn))
continue; continue;
if ((dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) || if ((dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) ||
(dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)) (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS))
pci_hp_add_bridge(dev); pci_hp_add_bridge(dev);
}
pci_assign_unassigned_bridge_resources(parent->self); pci_assign_unassigned_bridge_resources(parent->self);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment