From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot 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 Message-ID: In-Reply-To: <20260420063435.91650-1-mhun512@gmail.com> References: <20260420063435.91650-1-mhun512@gmail.com> <20260420063435.91650-1-mhun512@gmail.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review **Bug analysis:** The commit message accurately describes the problem. Look= ing 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 previou= sly the tail-call `return mipi_dsi_attach(dsi)`. If `mipi_dsi_attach()` fai= led, `drm_panel_remove()` was never called =E2=80=94 the `.remove()` callba= ck at line 2371 wouldn't fire because probe never completed successfully. **Code review:** The fix is straightforward and correct: ```c ret =3D 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 t= he cleanup order in `ili9881c_dsi_remove()` (line 2371=E2=80=932377), 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=E2=80=932354, `drm= _panel_of_backlight()` is called before `drm_panel_add()`. If `mipi_dsi_att= ach()` fails, the backlight acquired there is not explicitly cleaned up eit= her. However, since the panel is allocated with `devm_drm_panel_alloc()` (l= ine 2318), and the regulator/GPIO resources use `devm_` helpers, all device= -managed resources will be released automatically when probe fails. So this= is fine =E2=80=94 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_attac= h() fails, the driver returns without calling" and "drm_panel_remove()..." = at lines 102=E2=80=93103 of the mbox appears to be an unintentional line br= eak 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 pa= ttern of cleaning up `drm_panel_add()` on `mipi_dsi_attach()` failure. **Overall:** This is a correct, minimal bug fix. The only actionable feedba= ck 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