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: Add panel driver for ChipWealth CH13726A based panels Date: Tue, 28 Apr 2026 15:10:46 +1000 Message-ID: In-Reply-To: <20260426-ch13726a-v7-2-554247c569e5@gmail.com> References: <20260426-ch13726a-v7-0-554247c569e5@gmail.com> <20260426-ch13726a-v7-2-554247c569e5@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 **Issue 1 (Kconfig): Unnecessary DP helper selections** ```c select DRM_DISPLAY_DP_HELPER select DRM_DISPLAY_HELPER ``` This is a pure MIPI-DSI panel. The only other panel drivers that `select DR= M_DISPLAY_DP_HELPER` are eDP panels (Samsung ATNA33XC20, simple eDP). Compa= rable MIPI-DSI panel drivers like `DRM_PANEL_BOE_TD4320` select neither of = these. Both `select` lines should be removed =E2=80=94 the driver doesn't u= se any display helper or DP helper APIs. **Issue 2 (const-correctness): `desc` pointer and `thor_bottom_desc` should= be const** The descriptor struct is declared as: ```c struct ch13726a_desc *desc; ``` and `thor_bottom_desc` is: ```c static struct ch13726a_desc thor_bottom_desc =3D { ``` Since `of_device_get_match_data()` returns `const void *`, the current cast= discards const: ```c ctx->desc =3D (struct ch13726a_desc *)of_device_get_match_data(dev); ``` The field should be `const struct ch13726a_desc *desc`, the variable should= be `static const struct ch13726a_desc thor_bottom_desc`, and the cast shou= ld be `(const struct ch13726a_desc *)` (or better, dropped entirely since C= allows implicit conversion from `const void *` to `const T *`). **Issue 3 (style): `uint8_t` loop variable in `get_modes`** ```c for (uint8_t i =3D 0; i < ctx->desc->num_modes; i++) { ``` Kernel convention is to use `unsigned int` or `int` for loop counters, not = fixed-width types. `unsigned int` would match the type of `num_modes`. **Issue 4 (style): `__typeof(*ctx)` in `devm_drm_panel_alloc`** ```c ctx =3D devm_drm_panel_alloc(dev, __typeof(*ctx), panel, &ch13726a_panel_funcs, DRM_MODE_CONNECTOR_DSI); ``` While functionally correct, all other panel drivers pass the struct name di= rectly: ```c ctx =3D devm_drm_panel_alloc(dev, struct ch13726a_panel, panel, &ch13726a_panel_funcs, DRM_MODE_CONNECTOR_DSI); ``` **Observation (not a blocker): `of_drm_get_panel_orientation` error path** ```c ret =3D of_drm_get_panel_orientation(dev->of_node, &ctx->orientation); if (ret < 0) { dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, ret); return ret; } ``` This could use `dev_err_probe()` for consistency with the other error paths= in `probe()`, which would also handle `-EPROBE_DEFER` cleanly: ```c return dev_err_probe(dev, ret, "Failed to get orientation\n"); ``` **Overall for patch 2:** The driver logic itself is solid =E2=80=94 the res= et sequence, init commands, backlight handling, and multi-rate mode support= all look correct. The `mipi_dsi_multi_context` usage is clean, `prepare_pr= ev_first =3D true` is properly set, and the remove path correctly detaches = DSI before removing the panel. The issues above are all minor fixups. --- Generated by Claude Code Patch Reviewer