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/bridge: add of_drm_get_bridge_by_endpoint() Date: Tue, 05 May 2026 08:26:08 +1000 Message-ID: In-Reply-To: <20260504-drm-bridge-alloc-getput-panel_or_bridge-v4-2-b578c3daaf10@bootlin.com> References: <20260504-drm-bridge-alloc-getput-panel_or_bridge-v4-0-b578c3daaf10@bootlin.com> <20260504-drm-bridge-alloc-getput-panel_or_bridge-v4-2-b578c3daaf10@bootlin.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review **Status: Bug found** The implementation in `drm_bridge.c` is correct and clean. The function properly checks `of_graph_is_present()`, gets the remote node with `__free(device_node)` cleanup, calls `of_drm_find_and_get_bridge()`, and converts the NULL return to `ERR_PTR(-EPROBE_DEFER)`. **Bug: The non-OF inline stub has a type error that will break compilation when `CONFIG_OF` is disabled:** ```c static inline struct drm_bridge *of_drm_get_bridge_by_endpoint(const struct device_node *np, int port, int endpoint) { return -ENODEV; } ``` This returns a bare integer `-ENODEV` from a function returning `struct drm_bridge *`. This will trigger `-Wint-conversion` which is `-Werror` in the kernel build. It should be: ```c return ERR_PTR(-ENODEV); ``` Note that the existing stubs for `of_drm_find_and_get_bridge()` and `of_drm_find_bridge()` return `NULL`, while `devm_drm_of_get_bridge()` and `drmm_of_get_bridge()` return `ERR_PTR(-ENODEV)`. Since this new function's API contract is to return ERR_PTR on failure, `ERR_PTR(-ENODEV)` is the correct choice for the stub. --- Generated by Claude Code Patch Reviewer