Skip to content

Commit 373caf0

Browse files
author
Desnes Nunes
committed
usb: typec: tcpm: Use fwnode_get_child_node_count()
JIRA: https://issues.redhat.com/browse/RHEL-116016 commit 08ca89e Author: Andy Shevchenko <[email protected]> Date: Mon, 10 Mar 2025 16:54:54 +0200 Since fwnode_get_child_node_count() was split from its device property counterpart, we may utilise it in the driver and drop custom implementation. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Acked-by: Kyle Tso <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]> Signed-off-by: Desnes Nunes <[email protected]>
1 parent 42f5b5e commit 373caf0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/usb/typec/tcpm/tcpm.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7204,7 +7204,7 @@ static void tcpm_fw_get_timings(struct tcpm_port *port, struct fwnode_handle *fw
72047204

72057205
static int tcpm_fw_get_caps(struct tcpm_port *port, struct fwnode_handle *fwnode)
72067206
{
7207-
struct fwnode_handle *capabilities, *child, *caps = NULL;
7207+
struct fwnode_handle *capabilities, *caps = NULL;
72087208
unsigned int nr_src_pdo, nr_snk_pdo;
72097209
const char *opmode_str;
72107210
u32 *src_pdo, *snk_pdo;
@@ -7270,9 +7270,7 @@ static int tcpm_fw_get_caps(struct tcpm_port *port, struct fwnode_handle *fwnode
72707270
if (!capabilities) {
72717271
port->pd_count = 1;
72727272
} else {
7273-
fwnode_for_each_child_node(capabilities, child)
7274-
port->pd_count++;
7275-
7273+
port->pd_count = fwnode_get_child_node_count(capabilities);
72767274
if (!port->pd_count) {
72777275
ret = -ENODATA;
72787276
goto put_capabilities;

0 commit comments

Comments
 (0)