summaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2021-12-01 13:59:34 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-12-17 18:41:29 +0100
commit0d82017b70517b9b209ce7181d798a050ce23234 (patch)
tree019471166ba6dba5076e7c3782d66b2746ee1e25 /drivers/base
parentdevice property: Implement fwnode_graph_get_endpoint_count() (diff)
downloadlinux-0d82017b70517b9b209ce7181d798a050ce23234.tar.xz
linux-0d82017b70517b9b209ce7181d798a050ce23234.zip
device property: Use fwnode_graph_for_each_endpoint() macro
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> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/property.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/base/property.c b/drivers/base/property.c
index 39435ba64dac..3ff44dd92e52 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -1024,9 +1024,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;
@@ -1085,12 +1085,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;