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/rockchip: dw_hdmi: Use drmres helpers for encoder resources Date: Sat, 16 May 2026 16:14:38 +1000 Message-ID: In-Reply-To: <20260510183114.1248840-4-jonas@kwiboo.se> References: <20260510183114.1248840-1-jonas@kwiboo.se> <20260510183114.1248840-4-jonas@kwiboo.se> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review **Status: Clean** Switches from `devm_kzalloc`/`devm_kmemdup` to `drmm_kzalloc` and from `drm_simple_encoder_init` to `drmm_encoder_init`. This ties the lifetime of the `hdmi` struct and encoder to the DRM device rather than the platform device, which is the correct lifetime for DRM objects. The change from `devm_kmemdup` to `drmm_kzalloc` + `memcpy` is functionally equivalent and fine. The removal of the `err_bind` label and `drm_encoder_cleanup()` calls (both in error path and in `unbind`) is correct since `drmm_encoder_init` handles cleanup automatically. One ordering subtlety: `drmm_encoder_init()` is called **before** `dw_hdmi_bind()`, and the old code called `drm_simple_encoder_init()` at the same point. The `drm_encoder_helper_add()` is moved after `drmm_encoder_init()` which is correct -- helpers must be added after init. No issues. --- --- Generated by Claude Code Patch Reviewer