From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rob Herring (Arm)" <robh@kernel.org>,
Markus Elfring <elfring@users.sourceforge.net>,
"Jakob Riepler" <jakob+lkml@paranoidlabs.org>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
<linux-acpi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-leds@vger.kernel.org>, <linux-usb@vger.kernel.org>,
Daniel Scally <djrscally@gmail.com>,
"Sakari Ailus" <sakari.ailus@linux.intel.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Danilo Krummrich <dakr@kernel.org>, Lee Jones <lee@kernel.org>,
Pavel Machek <pavel@kernel.org>,
Matti Vaittinen <mazziesaccount@gmail.com>,
Jonathan Cameron <jic23@kernel.org>
Subject: Re: [PATCH v1 3/4] leds: ncp5623: Use fwnode_get_child_node_count()
Date: Tue, 11 Mar 2025 09:54:02 +0000 [thread overview]
Message-ID: <20250311095402.00002845@huawei.com> (raw)
In-Reply-To: <20250310150835.3139322-4-andriy.shevchenko@linux.intel.com>
On Mon, 10 Mar 2025 16:54:53 +0200
Andy Shevchenko <andriy.shevchenko@linux.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@linux.intel.com>
> ---
> drivers/leds/rgb/leds-ncp5623.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/leds/rgb/leds-ncp5623.c b/drivers/leds/rgb/leds-ncp5623.c
> index f18156683375..7c7d44623a9e 100644
> --- a/drivers/leds/rgb/leds-ncp5623.c
> +++ b/drivers/leds/rgb/leds-ncp5623.c
> @@ -155,9 +155,9 @@ static int ncp5623_probe(struct i2c_client *client)
> struct device *dev = &client->dev;
> struct fwnode_handle *mc_node, *led_node;
> struct led_init_data init_data = { };
> - int num_subleds = 0;
> struct ncp5623 *ncp;
> struct mc_subled *subled_info;
> + unsigned int num_subleds;
I have no idea what the scheme is for ordering here. My gut
feeling would have been to leave it in original location but it's
not something I feel strongly about.
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> u32 color_index;
> u32 reg;
> int ret;
> @@ -172,8 +172,7 @@ static int ncp5623_probe(struct i2c_client *client)
> if (!mc_node)
> return -EINVAL;
>
> - fwnode_for_each_child_node(mc_node, led_node)
> - num_subleds++;
> + num_subleds = fwnode_get_child_node_count(mc_node);
>
> subled_info = devm_kcalloc(dev, num_subleds, sizeof(*subled_info), GFP_KERNEL);
> if (!subled_info) {
next prev parent reply other threads:[~2025-03-11 9:54 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-10 14:54 [PATCH v1 0/4] leds: Introduce and use fwnode_get_child_node_count() Andy Shevchenko
2025-03-10 14:54 ` [PATCH v1 1/4] device property: Split fwnode_get_child_node_count() Andy Shevchenko
2025-03-11 9:51 ` Jonathan Cameron
2025-03-11 12:00 ` [PATCH " Markus Elfring
2025-03-11 12:05 ` Greg Kroah-Hartman
2025-03-12 11:36 ` [PATCH v1 " Heikki Krogerus
2025-03-14 13:43 ` Sakari Ailus
2025-03-14 20:12 ` Rafael J. Wysocki
2025-03-10 14:54 ` [PATCH v1 2/4] leds: pwm-multicolor: Use fwnode_get_child_node_count() Andy Shevchenko
2025-03-11 9:52 ` Jonathan Cameron
2025-03-10 14:54 ` [PATCH v1 3/4] leds: ncp5623: " Andy Shevchenko
2025-03-11 9:54 ` Jonathan Cameron [this message]
2025-03-12 10:57 ` Andy Shevchenko
2025-03-10 14:54 ` [PATCH v1 4/4] usb: typec: tcpm: " Andy Shevchenko
2025-03-11 9:55 ` Jonathan Cameron
2025-03-12 3:29 ` Kyle Tso
2025-03-12 11:36 ` Heikki Krogerus
2025-03-14 12:38 ` [PATCH v1 0/4] leds: Introduce and use fwnode_get_child_node_count() Lee Jones
2025-03-14 12:39 ` Lee Jones
2025-03-14 13:35 ` Andy Shevchenko
2025-03-21 11:03 ` Lee Jones
2025-04-10 9:13 ` Lee Jones
2025-04-10 9:12 ` Lee Jones
2025-04-15 16:57 ` [GIT PULL] Immutable branch between LEDS, Base and USB due for the v6.16 merge window Lee Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250311095402.00002845@huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=dakr@kernel.org \
--cc=djrscally@gmail.com \
--cc=elfring@users.sourceforge.net \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=jakob+lkml@paranoidlabs.org \
--cc=jic23@kernel.org \
--cc=lee@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mazziesaccount@gmail.com \
--cc=pavel@kernel.org \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=sakari.ailus@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).