mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
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 <lpieralisi@kernel.org> Cc: Hanjun Guo <guohanjun@huawei.com> Cc: Sudeep Holla <sudeep.holla@kernel.org> Reviewed-by: Ilkka Koskinen <ilkka@os.amperecomputing.com> Signed-off-by: Robin Murphy <robin.murphy@arm.com> Reviewed-by: Hanjun Guo <guohanjun@huawei.com> Signed-off-by: Will Deacon <will@kernel.org>
This commit is contained in:
parent
0263e0b788
commit
04aa909b38
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user