Skip to content

Commit cc89066

Browse files
paligregkh
authored andcommitted
PCI: aardvark: Simplify initialization of rootcap on virtual bridge
commit 454c532 upstream. PCIe config space can be initialized also before pci_bridge_emul_init() call, so move rootcap initialization after PCI config space initialization. This simplifies the function a little since it removes one if (ret < 0) check. Link: https://lore.kernel.org/r/20211005180952.6812-11-kabel@kernel.org Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Marek Behún <kabel@kernel.org> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Reviewed-by: Marek Behún <kabel@kernel.org> Signed-off-by: Marek Behún <kabel@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 70b131f commit cc89066

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

drivers/pci/controller/pci-aardvark.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,6 @@ static struct pci_bridge_emul_ops advk_pci_bridge_emul_ops = {
992992
static int advk_sw_pci_bridge_init(struct advk_pcie *pcie)
993993
{
994994
struct pci_bridge_emul *bridge = &pcie->bridge;
995-
int ret;
996995

997996
bridge->conf.vendor =
998997
cpu_to_le16(advk_readl(pcie, PCIE_CORE_DEV_ID_REG) & 0xffff);
@@ -1012,19 +1011,14 @@ static int advk_sw_pci_bridge_init(struct advk_pcie *pcie)
10121011
/* Support interrupt A for MSI feature */
10131012
bridge->conf.intpin = PCIE_CORE_INT_A_ASSERT_ENABLE;
10141013

1014+
/* Indicates supports for Completion Retry Status */
1015+
bridge->pcie_conf.rootcap = cpu_to_le16(PCI_EXP_RTCAP_CRSVIS);
1016+
10151017
bridge->has_pcie = true;
10161018
bridge->data = pcie;
10171019
bridge->ops = &advk_pci_bridge_emul_ops;
10181020

1019-
/* PCIe config space can be initialized after pci_bridge_emul_init() */
1020-
ret = pci_bridge_emul_init(bridge, 0);
1021-
if (ret < 0)
1022-
return ret;
1023-
1024-
/* Indicates supports for Completion Retry Status */
1025-
bridge->pcie_conf.rootcap = cpu_to_le16(PCI_EXP_RTCAP_CRSVIS);
1026-
1027-
return 0;
1021+
return pci_bridge_emul_init(bridge, 0);
10281022
}
10291023

10301024
static bool advk_pcie_valid_device(struct advk_pcie *pcie, struct pci_bus *bus,

0 commit comments

Comments
 (0)