From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: linux-acpi@vger.kernel.org
Cc: andriy.shevchenko@linux.intel.com,
heikki.krogerus@linux.intel.com, rafael@kernel.org,
/tmp/small/0000-cover-letter.patch@punajuuri.localdomain
Subject: [PATCH 6/7] device property: Use fwnode_graph_for_each_endpoint() macro
Date: Tue, 30 Nov 2021 17:32:49 +0200 [thread overview]
Message-ID: <20211130153250.935726-6-sakari.ailus@linux.intel.com> (raw)
In-Reply-To: <20211130153250.935726-1-sakari.ailus@linux.intel.com>
Now that we have fwnode_graph_for_each_endpoint() macro, use it instead of
calling fwnode_graph_get_next_endpoint() directly. It manages the iterator
variable for the user without manual intervention.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
drivers/base/property.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/base/property.c b/drivers/base/property.c
index 248034553005f..ba35d16e7f1f2 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -1072,9 +1072,9 @@ struct fwnode_handle *
fwnode_graph_get_remote_node(const struct fwnode_handle *fwnode, u32 port_id,
u32 endpoint_id)
{
- struct fwnode_handle *endpoint = NULL;
+ struct fwnode_handle *endpoint;
- while ((endpoint = fwnode_graph_get_next_endpoint(fwnode, endpoint))) {
+ fwnode_graph_for_each_endpoint(fwnode, endpoint) {
struct fwnode_endpoint fwnode_ep;
struct fwnode_handle *remote;
int ret;
@@ -1133,12 +1133,12 @@ struct fwnode_handle *
fwnode_graph_get_endpoint_by_id(const struct fwnode_handle *fwnode,
u32 port, u32 endpoint, unsigned long flags)
{
- struct fwnode_handle *ep = NULL, *best_ep = NULL;
+ struct fwnode_handle *ep, *best_ep = NULL;
unsigned int best_ep_id = 0;
bool endpoint_next = flags & FWNODE_GRAPH_ENDPOINT_NEXT;
bool enabled_only = !(flags & FWNODE_GRAPH_DEVICE_DISABLED);
- while ((ep = fwnode_graph_get_next_endpoint(fwnode, ep))) {
+ fwnode_graph_for_each_endpoint(fwnode, ep) {
struct fwnode_endpoint fwnode_ep = { 0 };
int ret;
--
2.30.2
next prev parent reply other threads:[~2021-11-30 15:32 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-30 15:32 [PATCH 1/7] device property: Fix fwnode_graph_devcon_match() fwnode leak Sakari Ailus
2021-11-30 15:32 ` [PATCH 2/7] device property: Fix documentation for FWNODE_GRAPH_DEVICE_DISABLED Sakari Ailus
2021-11-30 15:32 ` [PATCH 3/7] Documentation: ACPI: Fix data node reference documentation Sakari Ailus
2021-11-30 15:55 ` Andy Shevchenko
2021-11-30 20:42 ` Sakari Ailus
2021-11-30 20:50 ` Rafael J. Wysocki
2021-11-30 15:32 ` [PATCH 4/7] Documentation: ACPI: Update references Sakari Ailus
2021-11-30 15:57 ` Andy Shevchenko
2021-11-30 15:32 ` [PATCH 5/7] device property: Implement fwnode_graph_get_endpoint_count() Sakari Ailus
2021-11-30 16:01 ` Andy Shevchenko
2021-11-30 15:32 ` Sakari Ailus [this message]
2021-11-30 15:32 ` [PATCH 7/7] device property: Drop fwnode_graph_get_remote_node() Sakari Ailus
2021-11-30 16:05 ` Andy Shevchenko
2021-11-30 20:40 ` Sakari Ailus
2021-11-30 16:07 ` [PATCH 1/7] device property: Fix fwnode_graph_devcon_match() fwnode leak Andy Shevchenko
2021-11-30 20:21 ` Sakari Ailus
2021-12-01 13:19 ` Sakari Ailus
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=20211130153250.935726-6-sakari.ailus@linux.intel.com \
--to=sakari.ailus@linux.intel.com \
--cc=/tmp/small/0000-cover-letter.patch@punajuuri.localdomain \
--cc=andriy.shevchenko@linux.intel.com \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=rafael@kernel.org \
/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