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 <andriy.shevchenko@linux.intel.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Kyle Tso <kyletso@google.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20250310150835.3139322-5-andriy.shevchenko@linux.intel.com Signed-off-by: Lee Jones <lee@kernel.org>
1 parent 53762bb commit 08ca89e

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

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)