mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-14 10:02:33 -04:00
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>
This commit is contained in:
committed by
Lee Jones
parent
53762bb44b
commit
08ca89e986
@@ -7166,7 +7166,7 @@ static void tcpm_fw_get_timings(struct tcpm_port *port, struct fwnode_handle *fw
|
||||
|
||||
static int tcpm_fw_get_caps(struct tcpm_port *port, struct fwnode_handle *fwnode)
|
||||
{
|
||||
struct fwnode_handle *capabilities, *child, *caps = NULL;
|
||||
struct fwnode_handle *capabilities, *caps = NULL;
|
||||
unsigned int nr_src_pdo, nr_snk_pdo;
|
||||
const char *opmode_str;
|
||||
u32 *src_pdo, *snk_pdo;
|
||||
@@ -7232,9 +7232,7 @@ static int tcpm_fw_get_caps(struct tcpm_port *port, struct fwnode_handle *fwnode
|
||||
if (!capabilities) {
|
||||
port->pd_count = 1;
|
||||
} else {
|
||||
fwnode_for_each_child_node(capabilities, child)
|
||||
port->pd_count++;
|
||||
|
||||
port->pd_count = fwnode_get_child_node_count(capabilities);
|
||||
if (!port->pd_count) {
|
||||
ret = -ENODATA;
|
||||
goto put_capabilities;
|
||||
|
||||
Reference in New Issue
Block a user