From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/panel: ili9881c: remove panel on DSI attach failure
Date: Thu, 23 Apr 2026 10:16:31 +1000 [thread overview]
Message-ID: <review-patch1-20260420063435.91650-1-mhun512@gmail.com> (raw)
In-Reply-To: <20260420063435.91650-1-mhun512@gmail.com>
Patch Review
**Bug analysis:** The commit message accurately describes the problem. Looking at the probe function at `panel-ilitek-ili9881c.c:2313`, `drm_panel_add()` is called at line 2356 and then `mipi_dsi_attach()` at what was previously the tail-call `return mipi_dsi_attach(dsi)`. If `mipi_dsi_attach()` failed, `drm_panel_remove()` was never called — the `.remove()` callback at line 2371 wouldn't fire because probe never completed successfully.
**Code review:**
The fix is straightforward and correct:
```c
ret = mipi_dsi_attach(dsi);
if (ret) {
drm_panel_remove(&ctx->panel);
return ret;
}
return 0;
```
This properly unwinds the `drm_panel_add()` on the error path and matches the cleanup order in `ili9881c_dsi_remove()` (line 2371–2377), which calls `mipi_dsi_detach()` then `drm_panel_remove()`. Here only `drm_panel_remove()` is needed since `mipi_dsi_attach()` failed, so there's nothing to detach.
**Nits / observations:**
1. **No `drm_panel_of_backlight` cleanup?** At line 2352–2354, `drm_panel_of_backlight()` is called before `drm_panel_add()`. If `mipi_dsi_attach()` fails, the backlight acquired there is not explicitly cleaned up either. However, since the panel is allocated with `devm_drm_panel_alloc()` (line 2318), and the regulator/GPIO resources use `devm_` helpers, all device-managed resources will be released automatically when probe fails. So this is fine — the backlight registration is also devm-managed. This is not a problem with this patch.
2. **Commit message formatting:** The blank line between "If mipi_dsi_attach() fails, the driver returns without calling" and "drm_panel_remove()..." at lines 102–103 of the mbox appears to be an unintentional line break splitting a sentence across paragraphs. This should be reflowed into a single paragraph for the final commit message.
3. **The fix pattern is well-established.** Many other DRM panel drivers (e.g., `panel-boe-tv101wum-nl6.c`, `panel-novatek-nt35510.c`) use the same pattern of cleaning up `drm_panel_add()` on `mipi_dsi_attach()` failure.
**Overall:** This is a correct, minimal bug fix. The only actionable feedback is the commit message formatting nit (the spurious blank line splitting a sentence). The code change itself is clean and appropriate.
---
Generated by Claude Code Patch Reviewer
prev parent reply other threads:[~2026-04-23 0:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-20 6:34 [PATCH v1] drm/panel: ili9881c: remove panel on DSI attach failure Myeonghun Pak
2026-04-23 0:16 ` Claude review: " Claude Code Review Bot
2026-04-23 0:16 ` Claude Code Review Bot [this message]
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-patch1-20260420063435.91650-1-mhun512@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