]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
PCI: Simplify MPS test for Downstream Port
authorBjorn Helgaas <bhelgaas@google.com>
Thu, 22 Aug 2013 03:24:46 +0000 (11:24 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 22 Aug 2013 16:47:04 +0000 (10:47 -0600)
PCIe hotplug bridges are always either Root Ports or Downstream Ports.  No
other device type can have a PCIe link leading downstream to a slot.

Root Ports don't have an upstream bridge, so "dev->is_hotplug_bridge &&
dev->bus->self" is true if and only if "dev" is a Downstream Port.  That
means we can simplify this by looking at the type of "dev" itself, without
looking upstream at all.

No functional change.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/probe.c

index ecae7f2906470af3096cb4b578df9b87160b9dbe..0591b087a6c31b8db7429d27b6c02602bc7f1eac 100644 (file)
@@ -1507,8 +1507,7 @@ static int pcie_find_smpss(struct pci_dev *dev, void *data)
         * will occur as normal.
         */
        if (dev->is_hotplug_bridge && (!list_is_singular(&dev->bus->devices) ||
-            (dev->bus->self &&
-             pci_pcie_type(dev->bus->self) != PCI_EXP_TYPE_ROOT_PORT)))
+           pci_pcie_type(dev) != PCI_EXP_TYPE_ROOT_PORT))
                *smpss = 0;
 
        if (*smpss > dev->pcie_mpss)