]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/bridge: analogix_dp: Fix bailout for devm_drm_bridge_alloc()
authorLiu Ying <victor.liu@nxp.com>
Wed, 6 Aug 2025 09:52:24 +0000 (17:52 +0800)
committerLiu Ying <victor.liu@nxp.com>
Fri, 15 Aug 2025 03:19:56 +0000 (11:19 +0800)
commit50a8c08b8b69399a09c2dbcad8ef3fef9d9349d2
tree27ea02fbd81a1bdeefdb40ffb5e430ad4f0c716f
parenta52dffaa46c2c5ff0b311c4dc1288581f7b9109e
drm/bridge: analogix_dp: Fix bailout for devm_drm_bridge_alloc()

devm_drm_bridge_alloc() returns ERR_PTR on failure instead of a
NULL pointer, so use IS_ERR() to check the returned pointer.
While at it, on failure, return ERR_CAST(dp) instead of
ERR_PTR(-ENOMEM) in order not to depend on devm_drm_bridge_alloc()
error code implementation.

Fixes: 48f05c3b4b70 ("drm/bridge: analogix_dp: Use devm_drm_bridge_alloc() API")
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://lore.kernel.org/r/20250806095224.527938-1-victor.liu@nxp.com
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c