public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: mfd: lm3533: Convert to use OF bindings
Date: Mon, 18 May 2026 16:19:46 +1000	[thread overview]
Message-ID: <review-patch2-20260517074306.30937-3-clamor95@gmail.com> (raw)
In-Reply-To: <20260517074306.30937-3-clamor95@gmail.com>

Patch Review

This is the largest patch and has several bugs:

**Critical — MFD cell ID mismatch**: The LED MFD cells are defined with `cell->id` = 0,1,2,3:
```c
MFD_CELL_OF_REG("lm3533-leds", NULL, NULL, 0, 0, "ti,lm3533-leds", 2),
MFD_CELL_OF_REG("lm3533-leds", NULL, NULL, 0, 1, "ti,lm3533-leds", 3),
MFD_CELL_OF_REG("lm3533-leds", NULL, NULL, 0, 2, "ti,lm3533-leds", 4),
MFD_CELL_OF_REG("lm3533-leds", NULL, NULL, 0, 3, "ti,lm3533-leds", 5),
```
Since `devm_mfd_add_devices` is called with `id=0`, `pdev->id = 0 + cell->id`, giving 0,1,2,3. But in `lm3533_led_probe`, the check is:
```c
if (pdev->id < LM3533_LVCTRLBANK_MIN || pdev->id > LM3533_LVCTRLBANK_MAX)
```
where `LM3533_LVCTRLBANK_MIN=2`. So LED cells with `pdev->id` 0 and 1 will **always fail probe with `-EINVAL`**. And `led->id = pdev->id - LM3533_LVCTRLBANK_MIN` will produce wrong/negative values for cells 0 and 1.

Fix: The cell IDs should be 2,3,4,5 to match the DT reg values.

**DT property name mismatch**: The binding defines `ti,resistor-ohm`, but the driver reads a different name:
```c
device_property_read_u32(&pdev->dev, "ti,resistor-value-ohm",
                         &als->r_select);
```
This will silently fail to read the property on all boards that use the documented binding name.

**Dead code**: The `have_als`, `have_backlights`, `have_leds` flags are computed by scanning child nodes but never read anywhere in the new code — they're dead stores. Since `devm_mfd_add_devices` always registers all 7 cells regardless of these flags, the iteration and flag-setting should either be removed or used to conditionally register cells.

**Removed `iio_device_set_parent`**: The line `iio_device_set_parent(indio_dev, pdev->dev.parent)` is deleted without comment. This changes the IIO device's parent from the i2c device to the platform device. If this is intentional (for proper OF node association), it should be mentioned in the commit message.

**Minor — `linux,default-trigger` property**: The LEDs driver reads `linux,default-trigger` via `device_property_read_string`, but the DT binding in Patch 1 doesn't document this property (though it inherits from `common.yaml` which may cover it).

---
Generated by Claude Code Patch Reviewer

  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 Code Review Bot [this message]
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 review: " Claude Code Review Bot
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-patch2-20260517074306.30937-3-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