Rebase ArmVirtPkg/FdtPciHostBridgeLib to the new
PciHostBridgeUtilityGetRootBridges()/PciHostBridgeUtilityFreeRootBridges()
functions.
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3059
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Signed-off-by: Jiahui Cen <cenjiahui@huawei.com>
Signed-off-by: Yubo Miao <miaoyubo@huawei.com>
---
ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c | 24 +++++---------------
1 file changed, 6 insertions(+), 18 deletions(-)
diff --git a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c b/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c
index 3ec7992b6331..89582ef76eb3 100644
--- a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c
+++ b/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c
@@ -272,8 +272,6 @@ ProcessPciHost (
return Status;
}
-STATIC PCI_ROOT_BRIDGE mRootBridge;
-
/**
Return all the root bridge instances in an array.
@@ -361,8 +359,10 @@ PciHostBridgeGetRootBridges (
PMemAbove4G.Base = MAX_UINT64;
PMemAbove4G.Limit = 0;
- Status = PciHostBridgeUtilityInitRootBridge (
- Attributes,
+ *Count = 0;
+
+ return PciHostBridgeUtilityGetRootBridges (
+ Count,
Attributes,
AllocationAttributes,
TRUE,
@@ -373,19 +373,8 @@ PciHostBridgeGetRootBridges (
&Mem,
&MemAbove4G,
&PMem,
- &PMemAbove4G,
- &mRootBridge
+ &PMemAbove4G
);
- if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: failed to initialize PCI host bridge: %r\n",
- __FUNCTION__, Status));
- *Count = 0;
- return NULL;
- }
-
- *Count = 1;
-
- return &mRootBridge;
}
/**
@@ -402,8 +391,7 @@ PciHostBridgeFreeRootBridges (
UINTN Count
)
{
- ASSERT (Count == 1);
- PciHostBridgeUtilityUninitRootBridge (Bridges);
+ PciHostBridgeUtilityFreeRootBridges (Bridges, Count);
}
/**
--
2.29.2
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#70247): https://edk2.groups.io/g/devel/message/70247
Mute This Topic: https://groups.io/mt/79647755/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-