From: sashiko-bot@kernel.org
To: "Nora Schiffer" <nora.schiffer@ew.tq-group.com>
Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, robh@kernel.org,
linux-leds@vger.kernel.org, lee@kernel.org
Subject: Re: [PATCH 7/7] leds: pca995x: add support for group brightness control
Date: Wed, 02 Sep 2026 12:43:53 +0000 [thread overview]
Message-ID: <20260902124353.F33FB1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <225583885966f45079a7dafdbc2b1c419a25fa4b.1788350618.git.nora.schiffer@ew.tq-group.com>
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Medium] Missing explicit initialization of GRPPWM and MODE2 registers makes LED brightness dependent on undefined hardware states.
- [Low] The commit message description is not capitalized, violating LED subsystem naming conventions.
- [Low] has_errors_store uses strcmp() instead of sysfs_streq() to parse sysfs input, rejecting valid inputs without a newline.
--
commit 2816a66784d3fbb95bdf9b79d38d26cc4f4d0d96
Author: Nora Schiffer <nora.schiffer@ew.tq-group.com>
leds: pca995x: add support for group brightness control
This commit introduces group brightness control for PCA995x LEDs. It sets
the LEDs to group PWM mode, enabling global group PWM settings to modulate
individual brightness. It also adds a sysfs attribute for group brightness
and removes the non-group PWM setting.
> leds: pca995x: add support for group brightness control
[Severity: Low]
This isn't a bug, but does the commit message subject line violate the LED
subsystem naming conventions? Should the description after the subsystem
prefix be capitalized, such as "leds: pca995x: Add support for group
brightness control"?
> diff --git a/drivers/leds/leds-pca995x.c b/drivers/leds/leds-pca995x.c
> index 62f2764661b9d..d65c33edc83ab 100644
> --- a/drivers/leds/leds-pca995x.c
> +++ b/drivers/leds/leds-pca995x.c
[ ... ]
> @@ -110,11 +115,10 @@ static int pca995x_brightness_set(struct led_classdev *led_cdev,
>
> /*
> * Change LDRx configuration to individual brightness via PWM.
> - * LED will stop blinking if it's doing so.
> */
> return regmap_update_bits(chip->regmap, ledout_addr,
> PCA995X_LDRX_MASK << shift,
> - PCA995X_LED_PWM_MODE << shift);
> + PCA995X_LED_PWM_MODE_GRP << shift);
> }
[Severity: Medium]
Does this change make the LED brightness depend on undefined hardware states?
Without explicit initialization of the GRPPWM and MODE2 registers during
pca995x_probe(), a system without a reset GPIO might leave the PCA995x in an
unexpected state during a warm reboot.
If the driver loads and configures the LEDs into PCA995X_LED_PWM_MODE_GRP
while the registers aren't at their default values (GRPPWM=255 and
MODE2=dimming), will this cause incorrect behavior such as LEDs blinking or
remaining off instead of turning on dimly?
[ ... ]
> @@ -186,10 +190,41 @@ static ssize_t has_errors_store(struct device *dev, struct device_attribute *att
> return ret ?: count;
> }
[Severity: Low]
Is the parsing logic in has_errors_store() overly strict?
It currently uses strcmp(buf, "clear\n"), which rejects valid userspace
commands like 'echo -n clear' because they lack a trailing newline. Would it
be better to use sysfs_streq() instead to handle inputs both with and without
a newline?
--
Sashiko AI review · https://sashiko.dev/#/patchset/6d3600f99c77c31166f0b6a5ccfb7f518b53c4c9.1788350618.git.nora.schiffer@ew.tq-group.com?part=7
next prev parent reply other threads:[~2026-09-02 12:43 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 12:22 [PATCH 1/7] dt-bindings: leds: pca995x: describe reset-gpios property Nora Schiffer
2026-09-02 12:22 ` [PATCH 2/7] dt-bindings: leds: pca995x: describe output-gain property Nora Schiffer
2026-09-02 12:31 ` sashiko-bot
2026-09-02 13:10 ` Nora Schiffer
2026-09-03 8:34 ` Lee Jones
2026-09-03 13:09 ` Krzysztof Kozlowski
2026-09-02 12:22 ` [PATCH 3/7] leds: pca995x: add support for reset GPIO Nora Schiffer
2026-09-02 12:41 ` sashiko-bot
2026-09-02 12:22 ` [PATCH 4/7] leds: pca995x: make output gain configurable Nora Schiffer
2026-09-02 12:35 ` sashiko-bot
2026-09-02 12:22 ` [PATCH 5/7] leds: pca995x: add sysfs files for error reporting Nora Schiffer
2026-09-02 12:40 ` sashiko-bot
2026-09-02 12:22 ` [PATCH 6/7] leds: pca995x: do not use full on LED mode Nora Schiffer
2026-09-02 12:39 ` sashiko-bot
2026-09-02 12:22 ` [PATCH 7/7] leds: pca995x: add support for group brightness control Nora Schiffer
2026-09-02 12:43 ` sashiko-bot [this message]
2026-09-02 12:37 ` [PATCH 1/7] dt-bindings: leds: pca995x: describe reset-gpios property sashiko-bot
2026-09-02 16:16 ` Lee Jones
2026-09-03 6:42 ` Nora Schiffer
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=20260902124353.F33FB1F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=lee@kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=nora.schiffer@ew.tq-group.com \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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