[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250930-fix-amd-root-v1-2-ce28731c349f@amd.com>
Date: Tue, 30 Sep 2025 16:45:46 +0000
From: Yazen Ghannam <yazen.ghannam@....com>
To: <x86@...nel.org>
CC: <linux-kernel@...r.kernel.org>, Mario Limonciello
<mario.limonciello@....com>, Filip Barczyk <filip.barczyk@...o.net>, "Yazen
Ghannam" <yazen.ghannam@....com>
Subject: [PATCH 2/2] x86/amd_node: Use new root search helper
...to reduce code duplication.
No functional change intended.
Signed-off-by: Yazen Ghannam <yazen.ghannam@....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
Powered by blists - more mailing lists