[PATCH 1/4] ACPI/APMT: Use stable device ID
Ilkka Koskinen
ilkka at os.amperecomputing.com
Sun Jul 12 22:46:27 PDT 2026
On Thu, 9 Jul 2026, Robin Murphy wrote:
> On 09/07/2026 3:39 pm, Robin Murphy wrote:
>> 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.
That's a good idea.
>>
>> Cc: Lorenzo Pieralisi <lpieralisi at kernel.org>
>> Cc: Hanjun Guo <guohanjun at huawei.com>
>> Cc: Sudeep Holla <sudeep.holla at kernel.org>
>> Signed-off-by: Robin Murphy <robin.murphy at arm.com>
>> ---
>> drivers/acpi/arm64/apmt.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/acpi/arm64/apmt.c b/drivers/acpi/arm64/apmt.c
>> index bb010f6164e5..ba48fcb26d52 100644
>> --- a/drivers/acpi/arm64/apmt.c
>> +++ b/drivers/acpi/arm64/apmt.c
>> @@ -79,7 +79,7 @@ static int __init apmt_add_platform_device(struct
>> acpi_apmt_node *node,
>> int ret, count;
>> struct resource res[DEV_MAX_RESOURCE_COUNT];
>> - pdev = platform_device_alloc(DEV_NAME, PLATFORM_DEVID_AUTO);
>> + pdev = platform_device_alloc(DEV_NAME, node->id);
>
> Per the Sashiko comment, while I really wouldn't expect it to be an issue in
> practice, I guess we could explicitly check and truncate node->id to INT_MAX
> (probably with some degree of warning) here just in case.
Yeah, it probably and hopefully won't happen but it makes sense to have a
warning message regardless. With it
Reviewed-by: Ilkka Koskinen <ilkka at os.amperecomputing.com>
Cheers, Ilkka
>
> Cheers,
> Robin.
>
>> if (!pdev)
>> return -ENOMEM;
>>
>
>
More information about the linux-arm-kernel
mailing list