linux/drivers/gpu/drm/bridge/imx
Luca Ceresoli b99deb6157 drm/bridge: imx8qxp-pixel-link: 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, so 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.

To keep the code as simple and reliable as possible remove the intermediate
next_bridge and selected_bridge variables.

Get/put operations on the remaining pointer is pl->bridge.next_bridge,
which is tied to the struct imx8qxp_pixel_link lifetime, are:
 - get reference when assigned (by of_drm_find_and_get_bridge())
 - put reference before reassignment if reassignment happens
 - put reference when the struct imx8qxp_pixel_link embedding the
   struct drm_bridge is destroyed (struct drm_bridge::next_bridge)

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Acked-by: Liu Ying <victor.liu@nxp.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Link: https://lore.kernel.org/r/20260211-drm-bridge-alloc-getput-drm_of_find_bridge-v6-1-651ddfd13bdb@bootlin.com
History 2026-02-25 10:55:24 +08:00
..
imx-ldb-helper.c drm/bridge: imx8*-ldb: convert to devm_drm_bridge_alloc() API 2025-04-29 11:21:26 +02:00
imx-ldb-helper.h drm/bridge: imx8*-ldb: convert to devm_drm_bridge_alloc() API 2025-04-29 11:21:26 +02:00
imx-legacy-bridge.c drm/bridge: Include <linux/export.h> 2025-06-16 09:02:25 +02:00
imx8mp-hdmi-pai.c drm/bridge: imx8mp-hdmi-pai: enable PM runtime 2026-02-05 16:16:45 +08:00
imx8mp-hdmi-pvi.c drm/bridge: imx8mp-hdmi-pvi: convert to of_drm_find_and_get_bridge() 2026-01-20 14:53:46 +01:00
imx8mp-hdmi-tx.c drm/bridge: imx: add driver for HDMI TX Parallel Audio Interface 2025-09-29 09:46:04 +08:00
imx8qm-ldb.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
imx8qxp-ldb.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
imx8qxp-pixel-combiner.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
imx8qxp-pixel-link.c drm/bridge: imx8qxp-pixel-link: get/put the next bridge 2026-02-25 10:55:24 +08:00
imx8qxp-pxl2dpi.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
imx93-mipi-dsi.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
Kconfig drm/bridge: imx: add driver for HDMI TX Parallel Audio Interface 2025-09-29 09:46:04 +08:00
Makefile drm/bridge: imx: add driver for HDMI TX Parallel Audio Interface 2025-09-29 09:46:04 +08:00