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/mediatek: dsi: Store driver data before invoking mipi_dsi_host_register Date: Tue, 24 Feb 2026 10:09:17 +1000 Message-ID: In-Reply-To: <20260223141638.2022490-1-l.scorcia@gmail.com> References: <20260223141638.2022490-1-l.scorcia@gmail.com> <20260223141638.2022490-1-l.scorcia@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 The fix moves `platform_set_drvdata(pdev, dsi)` from after the IRQ request = and waitqueue initialization to just before `mipi_dsi_host_register()`: > + platform_set_drvdata(pdev, dsi); > + > ret =3D mipi_dsi_host_register(&dsi->host); > if (ret < 0) > return dev_err_probe(dev, ret, "Failed to register DSI host\n"); This is correct. The call chain `mipi_dsi_host_register` -> `mtk_dsi_host_a= ttach` -> `component_add` -> `mtk_dsi_bind` uses `dev_get_drvdata(dev)` to = retrieve the `mtk_dsi` struct, so the drvdata must be set before registrati= on. The `dsi` pointer at this point in `mtk_dsi_probe` has already been allocat= ed (via `devm_drm_bridge_alloc`), driver data matched, clocks obtained, reg= isters mapped, PHY acquired, and the IRQ number retrieved =E2=80=94 all the= fields that `mtk_dsi_bind` might need are initialized. The `host.ops` and = `host.dev` assignments are also already done on the lines immediately above. If `mipi_dsi_host_register()` fails after drvdata is set, the drvdata will = point to the `dsi` struct which is devres-managed and will be freed as part= of device cleanup =E2=80=94 this is harmless since the device itself won't= proceed to use the stale drvdata after a failed probe. No issues found. The fix is minimal, correct, and well-documented. --- Generated by Claude Code Patch Reviewer