Devicetree
 help / color / mirror / Atom feed
From: Griffin Kroah-Hartman <griffin@kroah.com>
To: Nora Schiffer <nora.schiffer@ew.tq-group.com>,
	Lee Jones <lee@kernel.org>, Pavel Machek <pavel@kernel.org>
Cc: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Isai Gaspar <isaiezequiel.gaspar@nxp.com>,
	Marek Vasut <marex@denx.de>,
	Pieterjan Camerlynck <pieterjanca@gmail.com>,
	Javier Carrasco <javier.carrasco.cruz@gmail.com>,
	linux@ew.tq-group.com, linux-leds@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 03/10] leds: pca995x: Fix maximum LED index for 16-channel variants
Date: Wed, 30 Sep 2026 16:58:35 +0200	[thread overview]
Message-ID: <3879be34-5389-4115-aeb2-29ba58228392@kroah.com> (raw)
In-Reply-To: <3926421f5734083348a6dc3e3c0d60de5d75a067.1790684839.git.nora.schiffer@ew.tq-group.com>

On 9/30/26 4:25 PM, Nora Schiffer wrote:

> The pca995x_chipdef for the 16-channel variants PCA9952 and PCA9955B
> correctly sets num_leds to 16, but the value was not actually used when
> checking and iterating over the LEDs during probe.
>
> Fixes: 68d6520d2e76 ("leds: leds-pca995x: Add support for NXP PCA9956B")
> Link: https://sashiko.dev/#/patchset/6d3600f99c77c31166f0b6a5ccfb7f518b53c4c9.1788350618.git.nora.schiffer@ew.tq-group.com
> Signed-off-by: Nora Schiffer <nora.schiffer@ew.tq-group.com>
> ---
>   drivers/leds/leds-pca995x.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/leds/leds-pca995x.c b/drivers/leds/leds-pca995x.c
> index fee6216cd1bd0..8b05b3f12cf38 100644
> --- a/drivers/leds/leds-pca995x.c
> +++ b/drivers/leds/leds-pca995x.c
> @@ -146,7 +146,7 @@ static int pca995x_probe(struct i2c_client *client)
>   		if (ret)
>   			return ret;
>   
> -		if (reg < 0 || reg >= PCA995X_MAX_OUTPUTS || led_fwnodes[reg])
> +		if (reg < 0 || reg >= chipdef->num_leds || led_fwnodes[reg])
>   			return -EINVAL;
>   
>   		led = &chip->leds[reg];
> @@ -157,7 +157,7 @@ static int pca995x_probe(struct i2c_client *client)
>   		led->ldev.max_brightness = 255;
>   	}
>   
> -	for (i = 0; i < PCA995X_MAX_OUTPUTS; i++) {
> +	for (i = 0; i < chipdef->num_leds; i++) {
>   		struct led_init_data init_data = {};
>   
>   		if (!led_fwnodes[i])
> @@ -169,7 +169,7 @@ static int pca995x_probe(struct i2c_client *client)
>   						     &chip->leds[i].ldev,
>   						     &init_data);
>   		if (ret < 0) {
> -			for (j = i; j < PCA995X_MAX_OUTPUTS; j++)
> +			for (j = i; j < chipdef->num_leds; j++)
>   				fwnode_handle_put(led_fwnodes[j]);
>   			return dev_err_probe(dev, ret,
>   					     "Could not register LED %s\n",
reviewed-by: Griffin Kroah-Hartman <griffin@kroah.com>

  reply	other threads:[~2026-09-30 14:58 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-30 14:25 [PATCH v4 00/10] leds: pca995x: Minor fixes; reset, output-gain, error reporting and group brightness support Nora Schiffer
2026-09-30 14:25 ` [PATCH v4 01/10] dt-bindings: leds: pca995x: Describe reset-gpios property Nora Schiffer
2026-09-30 15:02   ` sashiko-bot
2026-09-30 14:25 ` [PATCH v4 02/10] dt-bindings: leds: pca995x: Describe nxp,output-gain property Nora Schiffer
2026-09-30 15:09   ` sashiko-bot
2026-09-30 14:25 ` [PATCH v4 03/10] leds: pca995x: Fix maximum LED index for 16-channel variants Nora Schiffer
2026-09-30 14:58   ` Griffin Kroah-Hartman [this message]
2026-09-30 15:15   ` sashiko-bot
2026-09-30 14:25 ` [PATCH v4 04/10] leds: pca995x: Fix fwnode handle leaks in error paths Nora Schiffer
2026-09-30 15:24   ` sashiko-bot
2026-09-30 14:25 ` [PATCH v4 05/10] leds: pca995x: Write global registers before creating LED devices Nora Schiffer
2026-09-30 15:33   ` sashiko-bot
2026-09-30 14:25 ` [PATCH v4 06/10] leds: pca995x: Add support for reset GPIO Nora Schiffer
2026-09-30 15:37   ` sashiko-bot
2026-09-30 14:25 ` [PATCH v4 07/10] leds: pca995x: Make output gain configurable Nora Schiffer
2026-09-30 15:41   ` sashiko-bot
2026-09-30 14:25 ` [PATCH v4 08/10] leds: pca995x: Add sysfs files for error reporting Nora Schiffer
2026-09-30 15:48   ` sashiko-bot
2026-10-01  8:03     ` Nora Schiffer
2026-09-30 14:25 ` [PATCH v4 09/10] leds: pca995x: Do not use full on LED mode Nora Schiffer
2026-09-30 15:54   ` sashiko-bot
2026-09-30 14:25 ` [PATCH v4 10/10] leds: pca995x: Add support for group brightness control Nora Schiffer
2026-09-30 16:03   ` sashiko-bot

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=3879be34-5389-4115-aeb2-29ba58228392@kroah.com \
    --to=griffin@kroah.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=isaiezequiel.gaspar@nxp.com \
    --cc=javier.carrasco.cruz@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux@ew.tq-group.com \
    --cc=marex@denx.de \
    --cc=nora.schiffer@ew.tq-group.com \
    --cc=pavel@kernel.org \
    --cc=pieterjanca@gmail.com \
    --cc=robh@kernel.org \
    /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