Skip to content

Commit 08ca89e

Browse files
andy-shevlag-linaro
authored andcommitted
usb: typec: tcpm: Use fwnode_get_child_node_count()
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]>
1 parent 53762bb commit 08ca89e

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
@@ -7166,7 +7166,7 @@ static void tcpm_fw_get_timings(struct tcpm_port *port, struct fwnode_handle *fw
71667166

71677167
static int tcpm_fw_get_caps(struct tcpm_port *port, struct fwnode_handle *fwnode)
71687168
{
7169-
struct fwnode_handle *capabilities, *child, *caps = NULL;
7169+
struct fwnode_handle *capabilities, *caps = NULL;
71707170
unsigned int nr_src_pdo, nr_snk_pdo;
71717171
const char *opmode_str;
71727172
u32 *src_pdo, *snk_pdo;
@@ -7232,9 +7232,7 @@ static int tcpm_fw_get_caps(struct tcpm_port *port, struct fwnode_handle *fwnode
72327232
if (!capabilities) {
72337233
port->pd_count = 1;
72347234
} else {
7235-
fwnode_for_each_child_node(capabilities, child)
7236-
port->pd_count++;
7237-
7235+
port->pd_count = fwnode_get_child_node_count(capabilities);
72387236
if (!port->pd_count) {
72397237
ret = -ENODATA;
72407238
goto put_capabilities;

0 commit comments

Comments
 (0)