ACPI: arm64: use platform_device_set_fwnode()
Subsystems (2)
cover ACPI: arm64: use platform_device_set_fwnode()
Note: This must go through the driver core tree where the prerequisite commit 8877c06885ce ("driver core: platform: provide platform_device_set_fwnode()") lives before the upcoming merge window!
A series of recent changes in platform device code provided the platform_device_set_fwnode() helper but later changes converted all its users to different APIs. The function however should be used whenever a dynamically allocated platform device gets a firmware node assigned so use it in two such cases in ACPI arm64 drivers.
---
Bartosz Golaszewski (2):
ACPI/APMT: use platform_device_set_fwnode()
ACPI/IORT: use platform_device_set_fwnode()
drivers/acpi/arm64/apmt.c | 2 +- drivers/acpi/arm64/iort.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
---
base-commit: 0d33d21e47d9dc66f91e44da3fc9220c74d93df7
change-id: 20260728-acpi-arm64-pdev-set-fwnode-1d50f24a5c12
Best regards,
Signature · 1 line
Bartosz Golaszewski <[email protected]>
PATCH 1/2 ACPI/APMT: use platform_device_set_fwnode()
Platform devices using the split approach of calling platform_device_alloc() and platform_device_add() must not assign the firmware nodes manually but use the provided platform_device_set_fwnode() function which additionally makes sure we track the reference count of the firmware node correctly.
Replace the manual assignment of the firmware node with a call to platform_device_set_fwnode().
--- drivers/acpi/arm64/apmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/arm64/apmt.c +1 -1
@@ -99,7 +99,7 @@ static int __init apmt_add_platform_device(struct acpi_apmt_node *node,if (ret) goto dev_put; - pdev->dev.fwnode = fwnode; +platform_device_set_fwnode (pdev, fwnode); ret =platform_device_add (pdev);
Signature · 1 line
2.47.3
Re: [PATCH 1/2] ACPI/APMT: use platform_device_set_fwnode()
Quoted 9 lines · Bartosz Golaszewski
Platform devices using the split approach of calling
platform_device_alloc()andplatform_device_add()must not assign the firmware nodes manually but use the providedplatform_device_set_fwnode()function which additionally makes sure we track the reference count of the firmware node correctly.Replace the manual assignment of the firmware node with a call to
platform_device_set_fwnode().
I don't see platform_device_set_fwnode() in the upstream tree, is it in -next ? I didn't see -next tag as well.
Quoted 10 lines
Signed-off-by Bartosz Golaszewski <[email protected]>--- drivers/acpi/arm64/apmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/acpi/arm64/apmt.c +0
-0
drivers/acpi/arm64/apmt.c static int __init apmt_add_platform_device(struct acpi_apmt_node *node, · line 103
Quoted 6 lines
drivers/acpi/arm64/apmt.c +1
-1@@ -99,7 +99,7 @@ static int __init apmt_add_platform_device(struct acpi_apmt_node *node,if (ret) goto dev_put; - pdev->dev.fwnode = fwnode; +platform_device_set_fwnode (pdev, fwnode);
Assuming platform_device_set_fwnode() does what is needed,
Signature · 2 lines
Regards, Sudeep
Re: [PATCH 1/2] ACPI/APMT: use platform_device_set_fwnode()
Quoted 2 lines · Sudeep Holla
I don't see
platform_device_set_fwnode()in the upstream tree, is it in -next ? I didn't see -next tag as well.
It should be contained in linux-next through driver-core-next.
PATCH 2/2 ACPI/IORT: use platform_device_set_fwnode()
In reply to Bartosz GolaszewskiPlatform devices using the split approach of calling platform_device_alloc() and platform_device_add() must not assign the firmware nodes manually but use the provided platform_device_set_fwnode() function which additionally makes sure we track the reference count of the firmware node correctly.
Replace the manual assignment of the firmware node with a call to platform_device_set_fwnode().
--- drivers/acpi/arm64/iort.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/arm64/iort.c +1 -1
@@ -1992,7 +1992,7 @@ static int __init iort_add_platform_device(struct acpi_iort_node *node, goto dev_put; } - pdev->dev.fwnode = fwnode; +platform_device_set_fwnode (pdev, fwnode);if (ops->dev_dma_configure) ops->dev_dma_configure (&pdev->dev, node);
Signature · 1 line
2.47.3
Re: [PATCH 2/2] ACPI/IORT: use platform_device_set_fwnode()
Quoted 19 lines · Bartosz Golaszewski
Platform devices using the split approach of calling
platform_device_alloc()andplatform_device_add()must not assign the firmware nodes manually but use the providedplatform_device_set_fwnode()function which additionally makes sure we track the reference count of the firmware node correctly.Replace the manual assignment of the firmware node with a call to
platform_device_set_fwnode().Signed-off-by Bartosz Golaszewski <[email protected]>--- drivers/acpi/arm64/iort.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/acpi/arm64/iort.c +0
-0
drivers/acpi/arm64/iort.c static int __init iort_add_platform_device(struct acpi_iort_node *node, · line 1996
Quoted 6 lines
drivers/acpi/arm64/iort.c +1
-1@@ -1992,7 +1992,7 @@ static int __init iort_add_platform_device(struct acpi_iort_node *node, goto dev_put; } - pdev->dev.fwnode = fwnode; +platform_device_set_fwnode (pdev, fwnode);
With the condition specified in 1/2. I assume you plan to take it via the same tree that introduces platform_device_set_fwnode() ?
Signature · 2 lines
Regards, Sudeep
Danilo Krummrich
AppliedQuoted 1 line · Bartosz Golaszewski
[PATCH 0/2] ACPI: arm64: use
platform_device_set_fwnode()
Applied, thanks!
Branch: driver-core-testing
Tree: git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git
[1/2] ACPI/APMT: use platform_device_set_fwnode()
commit: 5ab289f5eabc
[2/2] ACPI/IORT: use platform_device_set_fwnode()
commit: 67b1e7245bd6The patches will appear in the next linux-next integration (typically within 24 hours on weekdays).
The patches are in the driver-core-testing branch and will be promoted to driver-core-next after validation.