diff mbox series

[v2] thunderbolt: ACPI: Use the helper fwnode_find_reference()

Message ID 20221024074846.84805-1-heikki.krogerus@linux.intel.com (mailing list archive)
State Accepted
Commit 2ae18cc2269fc2d05d36bf44a8daa4404fa11dde
Headers show
Series [v2] thunderbolt: ACPI: Use the helper fwnode_find_reference() | expand

Commit Message

Heikki Krogerus Oct. 24, 2022, 7:48 a.m. UTC
Replacing the direct fwnode_property_get_reference_args()
call will this wrapper function.

No functional changes intended.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
Changes since v1:
- Leaving the adev check untouched.
---
 drivers/thunderbolt/acpi.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

Comments

Mika Westerberg Oct. 25, 2022, 8:52 a.m. UTC | #1
On Mon, Oct 24, 2022 at 10:48:46AM +0300, Heikki Krogerus wrote:
> Replacing the direct fwnode_property_get_reference_args()
> call will this wrapper function.
> 
> No functional changes intended.
> 
> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

Applied to thunderbolt.git/next, thanks!
diff mbox series

Patch

diff --git a/drivers/thunderbolt/acpi.c b/drivers/thunderbolt/acpi.c
index 7a8adf5ad5a09..317e4f5fdb979 100644
--- a/drivers/thunderbolt/acpi.c
+++ b/drivers/thunderbolt/acpi.c
@@ -15,24 +15,20 @@  static acpi_status tb_acpi_add_link(acpi_handle handle, u32 level, void *data,
 				    void **return_value)
 {
 	struct acpi_device *adev = acpi_fetch_acpi_dev(handle);
-	struct fwnode_reference_args args;
 	struct fwnode_handle *fwnode;
 	struct tb_nhi *nhi = data;
 	struct pci_dev *pdev;
 	struct device *dev;
-	int ret;
 
 	if (!adev)
 		return AE_OK;
 
-	fwnode = acpi_fwnode_handle(adev);
-	ret = fwnode_property_get_reference_args(fwnode, "usb4-host-interface",
-						 NULL, 0, 0, &args);
-	if (ret)
+	fwnode = fwnode_find_reference(acpi_fwnode_handle(adev), "usb4-host-interface", 0);
+	if (IS_ERR(fwnode))
 		return AE_OK;
 
 	/* It needs to reference this NHI */
-	if (dev_fwnode(&nhi->pdev->dev) != args.fwnode)
+	if (dev_fwnode(&nhi->pdev->dev) != fwnode)
 		goto out_put;
 
 	/*
@@ -100,7 +96,7 @@  static acpi_status tb_acpi_add_link(acpi_handle handle, u32 level, void *data,
 	}
 
 out_put:
-	fwnode_handle_put(args.fwnode);
+	fwnode_handle_put(fwnode);
 	return AE_OK;
 }