mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 15:12:13 +02:00
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>
This commit is contained in:
parent
6802c7ee36
commit
900699ba83
|
|
@ -63,6 +63,13 @@ static int imx8qxp_pxl2dpi_bridge_attach(struct drm_bridge *bridge,
|
||||||
DRM_BRIDGE_ATTACH_NO_CONNECTOR);
|
DRM_BRIDGE_ATTACH_NO_CONNECTOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void imx8qxp_pxl2dpi_bridge_destroy(struct drm_bridge *bridge)
|
||||||
|
{
|
||||||
|
struct imx8qxp_pxl2dpi *p2d = bridge->driver_private;
|
||||||
|
|
||||||
|
drm_bridge_put(p2d->companion);
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
imx8qxp_pxl2dpi_bridge_atomic_check(struct drm_bridge *bridge,
|
imx8qxp_pxl2dpi_bridge_atomic_check(struct drm_bridge *bridge,
|
||||||
struct drm_bridge_state *bridge_state,
|
struct drm_bridge_state *bridge_state,
|
||||||
|
|
@ -205,6 +212,7 @@ static const struct drm_bridge_funcs imx8qxp_pxl2dpi_bridge_funcs = {
|
||||||
.atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
|
.atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
|
||||||
.atomic_reset = drm_atomic_helper_bridge_reset,
|
.atomic_reset = drm_atomic_helper_bridge_reset,
|
||||||
.attach = imx8qxp_pxl2dpi_bridge_attach,
|
.attach = imx8qxp_pxl2dpi_bridge_attach,
|
||||||
|
.destroy = imx8qxp_pxl2dpi_bridge_destroy,
|
||||||
.atomic_check = imx8qxp_pxl2dpi_bridge_atomic_check,
|
.atomic_check = imx8qxp_pxl2dpi_bridge_atomic_check,
|
||||||
.mode_set = imx8qxp_pxl2dpi_bridge_mode_set,
|
.mode_set = imx8qxp_pxl2dpi_bridge_mode_set,
|
||||||
.atomic_disable = imx8qxp_pxl2dpi_bridge_atomic_disable,
|
.atomic_disable = imx8qxp_pxl2dpi_bridge_atomic_disable,
|
||||||
|
|
@ -333,7 +341,7 @@ static int imx8qxp_pxl2dpi_parse_dt_companion(struct imx8qxp_pxl2dpi *p2d)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
p2d->companion = of_drm_find_bridge(companion);
|
p2d->companion = of_drm_find_and_get_bridge(companion);
|
||||||
if (!p2d->companion) {
|
if (!p2d->companion) {
|
||||||
ret = -EPROBE_DEFER;
|
ret = -EPROBE_DEFER;
|
||||||
DRM_DEV_DEBUG_DRIVER(p2d->dev,
|
DRM_DEV_DEBUG_DRIVER(p2d->dev,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user