From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Andreas Noever <andreas.noever@gmail.com>,
Michael Jamet <michael.jamet@intel.com>,
Yehezkel Bernat <YehezkelShB@gmail.com>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2] thunderbolt: ACPI: Use the helper fwnode_find_reference()
Date: Mon, 24 Oct 2022 10:48:46 +0300 [thread overview]
Message-ID: <20221024074846.84805-1-heikki.krogerus@linux.intel.com> (raw)
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(-)
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;
}
--
2.35.1
next reply other threads:[~2022-10-24 7:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-24 7:48 Heikki Krogerus [this message]
2022-10-25 8:52 ` [PATCH v2] thunderbolt: ACPI: Use the helper fwnode_find_reference() Mika Westerberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221024074846.84805-1-heikki.krogerus@linux.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=YehezkelShB@gmail.com \
--cc=andreas.noever@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=michael.jamet@intel.com \
--cc=mika.westerberg@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox