[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGZ6i=0GuBvEU41Offobn1MzMuFumn9F6JLHXsKppPidkjCLVw@mail.gmail.com>
Date: Wed, 12 Mar 2025 11:29:45 +0800
From: Kyle Tso <kyletso@...gle.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>, "Rob Herring (Arm)" <robh@...nel.org>,
Markus Elfring <elfring@...rs.sourceforge.net>, Jakob Riepler <jakob+lkml@...anoidlabs.org>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>, linux-acpi@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-leds@...r.kernel.org,
linux-usb@...r.kernel.org, Daniel Scally <djrscally@...il.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>, "Rafael J. Wysocki" <rafael@...nel.org>,
Danilo Krummrich <dakr@...nel.org>, Lee Jones <lee@...nel.org>, Pavel Machek <pavel@...nel.org>,
Matti Vaittinen <mazziesaccount@...il.com>, Jonathan Cameron <jic23@...nel.org>
Subject: Re: [PATCH v1 4/4] usb: typec: tcpm: Use fwnode_get_child_node_count()
On Mon, Mar 10, 2025 at 11:09 PM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
> 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@...ux.intel.com>
Acked-by: Kyle Tso <kyletso@...gle.com>
> ---
> drivers/usb/typec/tcpm/tcpm.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index 9c455f073233..8ca2e26752fb 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -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;
> --
> 2.47.2
>
>
Powered by blists - more mailing lists