Skip to contentSkip to conversation

device: property: Remove deadcode

PATCH In review [email protected] 2 participants 2 messages Nov 16, 2024 – Nov 18, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 device: property: Remove deadcode

From: "Dr. David Alan Gilbert" <[email protected]>

fwnode_graph_get_endpoint_count() was added in 2021 by commit c87b8fc56966 ("device property: Implement fwnode_graph_get_endpoint_count()")

but has never been used.

fwnode_graph_get_remote_port() has been unused since 2017's commit 6a71d8d77795 ("device property: Add fwnode_graph_get_port_parent")

Remove them.

---
 drivers/base/property.c  | 41 ----------------------------------------
 include/linux/property.h |  4 ----
 2 files changed, 45 deletions(-)
drivers/base/property.c +0 -41
index 837d77e3af2b..0cf8a7afaaee 100644
@@ -1116,22 +1116,6 @@ fwnode_graph_get_remote_port_parent(const struct fwnode_handle *fwnode)
 }
 EXPORT_SYMBOL_GPL(fwnode_graph_get_remote_port_parent);
 
-/**
- * fwnode_graph_get_remote_port - Return fwnode of a remote port
- * @fwnode: Endpoint firmware node pointing to the remote endpoint
- *
- * Extracts firmware node of a remote port the @fwnode points to.
- *
- * The caller is responsible for calling fwnode_handle_put() on the returned
- * fwnode pointer.
- */
-struct fwnode_handle *
-fwnode_graph_get_remote_port(const struct fwnode_handle *fwnode)
-{
-	return fwnode_get_next_parent(fwnode_graph_get_remote_endpoint(fwnode));
-}
-EXPORT_SYMBOL_GPL(fwnode_graph_get_remote_port);
-
 /**
  * fwnode_graph_get_remote_endpoint - Return fwnode of a remote endpoint
  * @fwnode: Endpoint firmware node pointing to the remote endpoint
@@ -1227,31 +1211,6 @@ fwnode_graph_get_endpoint_by_id(const struct fwnode_handle *fwnode,
 }
 EXPORT_SYMBOL_GPL(fwnode_graph_get_endpoint_by_id);
 
-/**
- * fwnode_graph_get_endpoint_count - Count endpoints on a device node
- * @fwnode: The node related to a device
- * @flags: fwnode lookup flags
- * Count endpoints in a device node.
- *
- * If FWNODE_GRAPH_DEVICE_DISABLED flag is specified, also unconnected endpoints
- * and endpoints connected to disabled devices are counted.
- */
-unsigned int fwnode_graph_get_endpoint_count(const struct fwnode_handle *fwnode,
-					     unsigned long flags)
-{
-	struct fwnode_handle *ep;
-	unsigned int count = 0;
-
-	fwnode_graph_for_each_endpoint(fwnode, ep) {
-		if (flags & FWNODE_GRAPH_DEVICE_DISABLED ||
-		    fwnode_graph_remote_available(ep))
-			count++;
-	}
-
-	return count;
-}
-EXPORT_SYMBOL_GPL(fwnode_graph_get_endpoint_count);
-
 /**
  * fwnode_graph_parse_endpoint - parse common endpoint node properties
  * @fwnode: pointer to endpoint fwnode_handle
include/linux/property.h +0 -4
index 61fc20e5f81f..4301f5130280 100644
@@ -470,8 +470,6 @@ struct fwnode_handle *
 fwnode_graph_get_port_parent(const struct fwnode_handle *fwnode);
 struct fwnode_handle *fwnode_graph_get_remote_port_parent(
 	const struct fwnode_handle *fwnode);
-struct fwnode_handle *fwnode_graph_get_remote_port(
-	const struct fwnode_handle *fwnode);
 struct fwnode_handle *fwnode_graph_get_remote_endpoint(
 	const struct fwnode_handle *fwnode);
 
@@ -497,8 +495,6 @@ static inline bool fwnode_graph_is_endpoint(const struct fwnode_handle *fwnode)
 struct fwnode_handle *
 fwnode_graph_get_endpoint_by_id(const struct fwnode_handle *fwnode,
 				u32 port, u32 endpoint, unsigned long flags);
-unsigned int fwnode_graph_get_endpoint_count(const struct fwnode_handle *fwnode,
-					     unsigned long flags);
 
 #define fwnode_graph_for_each_endpoint(fwnode, child)				\
 	for (child = fwnode_graph_get_next_endpoint(fwnode, NULL); child;	\
Signature · 1 line
2.47.0
reviewer
#1 lore raw

Hi David,

Thanks for the patch.

Quoted 6 lines · On Sat, Nov 16, 2024 at 12:32:53AM +0000, [email protected] wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

fwnode_graph_get_endpoint_count() was added in 2021 by commit c87b8fc56966 ("device property: Implement fwnode_graph_get_endpoint_count()")

Quoted 8 lines

but has never been used.

fwnode_graph_get_remote_port() has been unused since 2017's commit 6a71d8d77795 ("device property: Add fwnode_graph_get_port_parent")

Remove them.

Both of the functions also exist to span the same scope as the OF API, hence they should exist as long as the OF framework continues to provide these API functions. The equivalent OF functions are used by drivers currently.

Signature · 3 lines
Kind regards,

Sakari Ailus