Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/bridge: imx8qxp-pxl2dpi: get/put the companion bridge

This driver obtains a bridge pointer from of_drm_find_bridge() in the probe
function and stores it until driver removal. of_drm_find_bridge() is
deprecated. Move to of_drm_find_and_get_bridge() for the bridge to be
refcounted and use the destroy hook to put the reference on deallocation.

Reviewed-by: Maxime Ripard <mripard@kernel.org>
Link: https://patch.msgid.link/20251216-drm-bridge-alloc-getput-drm_of_find_bridge-v3-17-b5165fab8058@bootlin.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

+9 -1
+9 -1
drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c
··· 63 63 DRM_BRIDGE_ATTACH_NO_CONNECTOR); 64 64 } 65 65 66 + static void imx8qxp_pxl2dpi_bridge_destroy(struct drm_bridge *bridge) 67 + { 68 + struct imx8qxp_pxl2dpi *p2d = bridge->driver_private; 69 + 70 + drm_bridge_put(p2d->companion); 71 + } 72 + 66 73 static int 67 74 imx8qxp_pxl2dpi_bridge_atomic_check(struct drm_bridge *bridge, 68 75 struct drm_bridge_state *bridge_state, ··· 212 205 .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, 213 206 .atomic_reset = drm_atomic_helper_bridge_reset, 214 207 .attach = imx8qxp_pxl2dpi_bridge_attach, 208 + .destroy = imx8qxp_pxl2dpi_bridge_destroy, 215 209 .atomic_check = imx8qxp_pxl2dpi_bridge_atomic_check, 216 210 .mode_set = imx8qxp_pxl2dpi_bridge_mode_set, 217 211 .atomic_disable = imx8qxp_pxl2dpi_bridge_atomic_disable, ··· 341 333 goto out; 342 334 } 343 335 344 - p2d->companion = of_drm_find_bridge(companion); 336 + p2d->companion = of_drm_find_and_get_bridge(companion); 345 337 if (!p2d->companion) { 346 338 ret = -EPROBE_DEFER; 347 339 DRM_DEV_DEBUG_DRIVER(p2d->dev,