From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: video: leds: backlight: lm3533: Support getting LED sources from DT
Date: Mon, 18 May 2026 16:19:47 +1000 [thread overview]
Message-ID: <review-patch6-20260517074306.30937-7-clamor95@gmail.com> (raw)
In-Reply-To: <20260517074306.30937-7-clamor95@gmail.com>
Patch Review
This patch has multiple bugs:
**Bug — wrong register in LED driver**: The second `lm3533_update` for LVLED4/5 writes to `LM3533_REG_OUTPUT_CONF1` instead of `LM3533_REG_OUTPUT_CONF2`:
```c
/* LVLED4 and LVLED5 */
ret = lm3533_update(led->lm3533, LM3533_REG_OUTPUT_CONF1, // should be OUTPUT_CONF2
output_cfg_val >> OUTPUT_CONF2_SHIFT,
OUTPUT_CONF2_MASK);
```
**Bug — off-by-one in led-sources reading**: Both drivers have the same issue:
```c
if (led->num_leds > 0 && led->num_leds < LM3533_MAX_LEDS) {
```
This excludes the case where `num_leds == LM3533_MAX_LEDS` (5), meaning if all 5 LVLEDs are specified, the array is never read. The condition should be `<=`:
```c
if (led->num_leds > 0 && led->num_leds <= LM3533_MAX_LEDS) {
```
Same issue in the backlight driver with `LM3533_MAX_LED_STRINGS` (2) — specifying both HVLED strings skips the read.
**Design flaw — wide masks clobber other banks**: The output config registers are shared between all banks. The LED driver uses `OUTPUT_CONF1_MASK = GENMASK(7, 2)` which covers ALL three LVLEDs, and `OUTPUT_CONF2_MASK = GENMASK(3, 0)` covers both LVLED4/5. Each LED bank probe overwrites the entire set of LVLED mappings, clobbering configurations from previously-probed banks.
Compare with the existing `lm3533_set_lvled_config()` which correctly computes a **per-LVLED** 2-bit mask:
```c
mask = LM3533_LED_ID_MASK << shift;
val = led << shift;
ret = lm3533_update(lm3533, reg, val, mask);
```
The patch should use narrow per-LVLED masks or, better yet, call the existing `lm3533_set_lvled_config`/`lm3533_set_hvled_config` functions instead of reimplementing the register manipulation.
**Same clobbering issue in backlight**: The backlight driver uses `OUTPUT_CONF1_MASK = GENMASK(1, 0)`, writing both HVLED config bits at once. If bank A probes first and sets HVLED1, bank B probing second will overwrite both bits.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-18 6:19 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-17 7:43 [PATCH v1 0/6] mfd: lm3533: convert to OF bindings, improve support Svyatoslav Ryhel
2026-05-17 7:43 ` [PATCH v1 1/6] dt-bindings: leds: Document TI LM3533 LED controller Svyatoslav Ryhel
2026-05-17 13:44 ` Jonathan Cameron
2026-05-17 14:26 ` Svyatoslav Ryhel
2026-05-18 6:19 ` Claude review: " Claude Code Review Bot
2026-05-17 7:43 ` [PATCH v1 2/6] mfd: lm3533: Convert to use OF bindings Svyatoslav Ryhel
2026-05-17 7:55 ` Andy Shevchenko
2026-05-17 10:11 ` Svyatoslav Ryhel
2026-05-17 11:10 ` Svyatoslav Ryhel
2026-05-18 6:19 ` Claude review: " Claude Code Review Bot
2026-05-17 7:43 ` [PATCH v1 3/6] mfd: lm3533: Add support for VIN power supply Svyatoslav Ryhel
2026-05-18 6:19 ` Claude review: " Claude Code Review Bot
2026-05-17 7:43 ` [PATCH v1 4/6] mfd: lm3533: set DMA mask Svyatoslav Ryhel
2026-05-18 6:19 ` Claude review: " Claude Code Review Bot
2026-05-17 7:43 ` [PATCH v1 5/6] video: backlight: lm3533_bl: Set initial mapping mode from DT Svyatoslav Ryhel
2026-05-18 6:19 ` Claude review: " Claude Code Review Bot
2026-05-17 7:43 ` [PATCH v1 6/6] video: leds: backlight: lm3533: Support getting LED sources " Svyatoslav Ryhel
2026-05-18 6:19 ` Claude Code Review Bot [this message]
2026-05-17 7:59 ` [PATCH v1 0/6] mfd: lm3533: convert to OF bindings, improve support Andy Shevchenko
2026-05-17 10:13 ` Svyatoslav Ryhel
2026-05-17 10:20 ` Andy Shevchenko
2026-05-17 10:34 ` Svyatoslav Ryhel
2026-05-17 10:40 ` Andy Shevchenko
2026-05-17 10:44 ` Svyatoslav Ryhel
2026-05-18 6:19 ` Claude review: " Claude Code Review 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=review-patch6-20260517074306.30937-7-clamor95@gmail.com \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.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