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 next 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 bridge->next_bridge 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-16-b5165fab8058@bootlin.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

+5 -6
+5 -6
drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c
··· 35 35 struct imx8qxp_pxl2dpi { 36 36 struct regmap *regmap; 37 37 struct drm_bridge bridge; 38 - struct drm_bridge *next_bridge; 39 38 struct drm_bridge *companion; 40 39 struct device *dev; 41 40 struct imx_sc_ipc *ipc_handle; ··· 59 60 } 60 61 61 62 return drm_bridge_attach(encoder, 62 - p2d->next_bridge, bridge, 63 + p2d->bridge.next_bridge, bridge, 63 64 DRM_BRIDGE_ATTACH_NO_CONNECTOR); 64 65 } 65 66 ··· 270 271 return -ENODEV; 271 272 } 272 273 273 - p2d->next_bridge = of_drm_find_bridge(remote); 274 - if (!p2d->next_bridge) 274 + p2d->bridge.next_bridge = of_drm_find_and_get_bridge(remote); 275 + if (!p2d->bridge.next_bridge) 275 276 return -EPROBE_DEFER; 276 277 277 278 return 0; ··· 350 351 * the next bridges are connected to. If they are marked as expecting 351 352 * even pixels and odd pixels than we need to use the companion PXL2DPI. 352 353 */ 353 - port1 = of_graph_get_port_by_id(p2d->next_bridge->of_node, 1); 354 - port2 = of_graph_get_port_by_id(companion_p2d->next_bridge->of_node, 1); 354 + port1 = of_graph_get_port_by_id(p2d->bridge.next_bridge->of_node, 1); 355 + port2 = of_graph_get_port_by_id(companion_p2d->bridge.next_bridge->of_node, 1); 355 356 dual_link = drm_of_lvds_get_dual_link_pixel_order(port1, port2); 356 357 of_node_put(port1); 357 358 of_node_put(port2);