From 04aa909b38bfe9a7e9b052f2c66b98d33f6f8a64 Mon Sep 17 00:00:00 2001 From: Robin Murphy Date: Thu, 16 Jul 2026 15:56:34 +0100 Subject: [PATCH] ACPI/APMT: Use stable device ID The APMT node format includes a unique identifier, so we can use this as the platform device ID to give userspace stable and identifiable device names, rather than auto numbering dependent on how the table is parsed. Cc: Lorenzo Pieralisi Cc: Hanjun Guo Cc: Sudeep Holla Reviewed-by: Ilkka Koskinen Signed-off-by: Robin Murphy Reviewed-by: Hanjun Guo Signed-off-by: Will Deacon --- drivers/acpi/arm64/apmt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/arm64/apmt.c b/drivers/acpi/arm64/apmt.c index bb010f6164e5..91fcdd289e63 100644 --- a/drivers/acpi/arm64/apmt.c +++ b/drivers/acpi/arm64/apmt.c @@ -76,10 +76,12 @@ static int __init apmt_add_platform_device(struct acpi_apmt_node *node, struct fwnode_handle *fwnode) { struct platform_device *pdev; - int ret, count; + int ret, count, uid = node->id & INT_MAX; struct resource res[DEV_MAX_RESOURCE_COUNT]; - pdev = platform_device_alloc(DEV_NAME, PLATFORM_DEVID_AUTO); + if (uid != node->id) + pr_warn("Unexpectedly large UID 0x%x, truncated to 0x%x\n", node->id, uid); + pdev = platform_device_alloc(DEV_NAME, uid); if (!pdev) return -ENOMEM;