PCI: Allow PCI express root ports to find themselves
authorThierry Reding <treding@nvidia.com>
Thu, 17 Aug 2017 11:06:14 +0000 (13:06 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Aug 2017 23:14:37 +0000 (16:14 -0700)
commitb6f6d56c91f5261c55edef2df300698c4486b669
tree29d44f8bdb6e0e9fd844b975bab9d2f6144c0aff
parentcdbeb633ca71a02b7b63bfeb94994bf4e1a0b894
PCI: Allow PCI express root ports to find themselves

If the pci_find_pcie_root_port() function is called on a root port
itself, return the root port rather than NULL.

This effectively reverts commit 0e405232871d6 ("PCI: fix oops when
try to find Root Port for a PCI device") which added an extra check
that would now be redundant.

Fixes: a99b646afa8a ("PCI: Disable PCIe Relaxed Ordering if unsupported")
Fixes: c56d4450eb68 ("PCI: Turn off Request Attributes to avoid Chelsio T5 Completion erratum")
Signed-off-by: Thierry Reding <treding@nvidia.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Shawn Lin <shawn.lin@rock-chips.com>
Tested-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/pci/pci.c