Commit 0bbca46c authored by Luca Ceresoli's avatar Luca Ceresoli
Browse files

drm/bridge: tpd12s015: convert to of_drm_find_and_get_bridge()



of_drm_find_bridge() is deprecated. Move to its replacement
of_drm_find_and_get_bridge() which gets a bridge reference, and ensure it
is put when done by using the drm_bridge::next_bridge pointer.

Acked-by: default avatarMaxime Ripard <mripard@kernel.org>
Link: https://patch.msgid.link/20260109-drm-bridge-alloc-getput-drm_of_find_bridge-2-v2-6-8bad3ef90b9f@bootlin.com


Signed-off-by: default avatarLuca Ceresoli <luca.ceresoli@bootlin.com>
parent 35dd5e1c
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -28,8 +28,6 @@ struct tpd12s015_device {
	struct gpio_desc *ls_oe_gpio;
	struct gpio_desc *hpd_gpio;
	int hpd_irq;

	struct drm_bridge *next_bridge;
};

static inline struct tpd12s015_device *to_tpd12s015(struct drm_bridge *bridge)
@@ -47,7 +45,7 @@ static int tpd12s015_attach(struct drm_bridge *bridge,
	if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR))
		return -EINVAL;

	ret = drm_bridge_attach(encoder, tpd->next_bridge,
	ret = drm_bridge_attach(encoder, tpd->bridge.next_bridge,
				bridge, flags);
	if (ret < 0)
		return ret;
@@ -138,10 +136,10 @@ static int tpd12s015_probe(struct platform_device *pdev)
	if (!node)
		return -ENODEV;

	tpd->next_bridge = of_drm_find_bridge(node);
	tpd->bridge.next_bridge = of_drm_find_and_get_bridge(node);
	of_node_put(node);

	if (!tpd->next_bridge)
	if (!tpd->bridge.next_bridge)
		return -EPROBE_DEFER;

	/* Get the control and HPD GPIOs. */