[PATCH 3/3] platform/x86/amd: hfi: Rely on ACPI enumeration instead of a dummy device
From: Mario Limonciello
Date: Mon Sep 21 2026 - 13:09:57 EST
amd_hfi_init() manually registers a platform device with
platform_device_register_simple() before registering the driver. This
device has no ACPI companion, so when amd_hfi_probe() runs for it the
acpi_match_device() check fails and probe returns -ENODEV.
The driver already advertises an ACPI match table, so the ACPI subsystem
enumerates the real AMDI0104 device and binds it to the driver. The
manually created device therefore serves no purpose: it never binds and
lingers as an unbound platform device, wasting memory and cluttering the
device tree.
Drop the manual platform_device_register_simple() and the device that
tracked it, and rely solely on ACPI enumeration. The CPU feature gating
in amd_hfi_init() is retained so the driver is only registered on
supported hardware.
Signed-off-by: Mario Limonciello <mario.limonciello@xxxxxxx>
---
drivers/platform/x86/amd/hfi/hfi.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/drivers/platform/x86/amd/hfi/hfi.c b/drivers/platform/x86/amd/hfi/hfi.c
index 6d1d3b6c28a97..a923345dd1cf6 100644
--- a/drivers/platform/x86/amd/hfi/hfi.c
+++ b/drivers/platform/x86/amd/hfi/hfi.c
@@ -39,8 +39,6 @@
#define AMD_HETERO_CPUID_27 0x80000027
-static struct platform_device *device;
-
/**
* struct amd_shmem_info - Shared memory table for AMD HFI
*
@@ -540,12 +538,6 @@ static int __init amd_hfi_init(void)
!cpu_feature_enabled(X86_FEATURE_AMD_WORKLOAD_CLASS))
return -ENODEV;
- device = platform_device_register_simple(AMD_HFI_DRIVER, -1, NULL, 0);
- if (IS_ERR(device)) {
- pr_err("unable to register HFI platform device\n");
- return PTR_ERR(device);
- }
-
ret = platform_driver_register(&amd_hfi_driver);
if (ret)
pr_err("failed to register HFI driver\n");
@@ -556,7 +548,6 @@ static int __init amd_hfi_init(void)
static __exit void amd_hfi_exit(void)
{
platform_driver_unregister(&amd_hfi_driver);
- platform_device_unregister(device);
}
module_init(amd_hfi_init);
module_exit(amd_hfi_exit);
--
2.55.0