Thread (58 messages) 58 messages, 8 authors, 2025-10-09
STALE264d

[PATCH v2 15/16] property: Drop functions operating on "available" child nodes

From: Sakari Ailus <sakari.ailus@linux.intel.com>
Date: 2025-09-24 07:46:34
Also in: linux-acpi, linux-leds, linux-media, linux-spi, lkml, netdev
Subsystem: driver core, kobjects, debugfs and sysfs, software nodes and device properties, the rest · Maintainers: Greg Kroah-Hartman, "Rafael J. Wysocki", Danilo Krummrich, Linus Torvalds

fwnode_get_next_available_child_node() and later
fwnode_for_each_available_child_node() were introduced to mirror the OF
interface operating on OF nodes. Now that these two are functionally the
same as the variants without "_available" part, drop the "_available"
variants.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/base/property.c  | 30 +-----------------------------
 include/linux/property.h |  6 ------
 2 files changed, 1 insertion(+), 35 deletions(-)
diff --git a/drivers/base/property.c b/drivers/base/property.c
index ff440456af7b..75c3283fb5ca 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -802,35 +802,7 @@ fwnode_get_next_child_node(const struct fwnode_handle *fwnode,
 EXPORT_SYMBOL_GPL(fwnode_get_next_child_node);
 
 /**
- * fwnode_get_next_available_child_node - Return the next available child node handle for a node
- * @fwnode: Firmware node to find the next child node for.
- * @child: Handle to one of the node's child nodes or a %NULL handle.
- *
- * The caller is responsible for calling fwnode_handle_put() on the returned
- * fwnode pointer. Note that this function also puts a reference to @child
- * unconditionally.
- */
-struct fwnode_handle *
-fwnode_get_next_available_child_node(const struct fwnode_handle *fwnode,
-				     struct fwnode_handle *child)
-{
-	struct fwnode_handle *next_child = child;
-
-	if (IS_ERR_OR_NULL(fwnode))
-		return NULL;
-
-	do {
-		next_child = fwnode_get_next_child_node(fwnode, next_child);
-		if (!next_child)
-			return NULL;
-	} while (!fwnode_device_is_available(next_child));
-
-	return next_child;
-}
-EXPORT_SYMBOL_GPL(fwnode_get_next_available_child_node);
-
-/**
- * device_get_next_child_node - Return the next available child node handle for a device
+ * device_get_next_child_node - Return the next available child node handle
  * @dev: Device to find the next child node for.
  * @child: Handle to one of the device's child nodes or a %NULL handle.
  *
diff --git a/include/linux/property.h b/include/linux/property.h
index 8b8bbbe6b5b7..da6202053862 100644
--- a/include/linux/property.h
+++ b/include/linux/property.h
@@ -161,8 +161,6 @@ struct fwnode_handle *fwnode_get_nth_parent(struct fwnode_handle *fwn,
 					    unsigned int depth);
 struct fwnode_handle *fwnode_get_next_child_node(
 	const struct fwnode_handle *fwnode, struct fwnode_handle *child);
-struct fwnode_handle *fwnode_get_next_available_child_node(
-	const struct fwnode_handle *fwnode, struct fwnode_handle *child);
 
 #define fwnode_for_each_child_node(fwnode, child)			\
 	for (child = fwnode_get_next_child_node(fwnode, NULL); child;	\
@@ -172,10 +170,6 @@ struct fwnode_handle *fwnode_get_next_available_child_node(
 	fwnode_for_each_child_node(fwnode, child)			\
 		for_each_if(fwnode_name_eq(child, name))
 
-#define fwnode_for_each_available_child_node(fwnode, child)		       \
-	for (child = fwnode_get_next_available_child_node(fwnode, NULL); child;\
-	     child = fwnode_get_next_available_child_node(fwnode, child))
-
 struct fwnode_handle *device_get_next_child_node(const struct device *dev,
 						 struct fwnode_handle *child);
 
-- 
2.47.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help