[PATCH 2/2] x86/amd_node: Use new root search helper

Yazen Ghannam
2025-09-30T16:47:33Z

...to reduce code duplication.

No functional change intended.

Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
---
arch/x86/kernel/amd_node.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/arch/x86/kernel/amd_node.c b/arch/x86/kernel/amd_node.c
index 4a3d9ca6e225..02254e2034bd 100644
--- a/arch/x86/kernel/amd_node.c
+++ b/arch/x86/kernel/amd_node.c
@@ -268,18 +268,8 @@ static int amd_cache_roots(void)
static int reserve_root_config_spaces(void)
{
struct pci_dev *root = NULL;
- struct pci_bus *bus = NULL;
-
- while ((bus = pci_find_next_bus(bus))) {
- /* Root device is Device 0 Function 0 on each Primary Bus. */
- root = pci_get_slot(bus, 0);
- if (!root)
- continue;
-
- if (root->vendor != PCI_VENDOR_ID_AMD &&
- root->vendor != PCI_VENDOR_ID_HYGON)
- continue;

+ while ((root = get_next_root(root))) {
pci_dbg(root, "Reserving PCI config space\n");

/*

--
2.51.0