mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 13:41:48 -04:00
drm/bridge: imx8mp-hdmi-pvi: 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: Maxime Ripard <mripard@kernel.org> Link: https://patch.msgid.link/20260109-drm-bridge-alloc-getput-drm_of_find_bridge-2-v2-8-8bad3ef90b9f@bootlin.com Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
This commit is contained in:
@@ -29,7 +29,6 @@
|
||||
struct imx8mp_hdmi_pvi {
|
||||
struct drm_bridge bridge;
|
||||
struct device *dev;
|
||||
struct drm_bridge *next_bridge;
|
||||
void __iomem *regs;
|
||||
};
|
||||
|
||||
@@ -45,7 +44,7 @@ static int imx8mp_hdmi_pvi_bridge_attach(struct drm_bridge *bridge,
|
||||
{
|
||||
struct imx8mp_hdmi_pvi *pvi = to_imx8mp_hdmi_pvi(bridge);
|
||||
|
||||
return drm_bridge_attach(encoder, pvi->next_bridge,
|
||||
return drm_bridge_attach(encoder, pvi->bridge.next_bridge,
|
||||
bridge, flags);
|
||||
}
|
||||
|
||||
@@ -78,8 +77,8 @@ static void imx8mp_hdmi_pvi_bridge_enable(struct drm_bridge *bridge,
|
||||
if (mode->flags & DRM_MODE_FLAG_PHSYNC)
|
||||
val |= PVI_CTRL_OP_HSYNC_POL | PVI_CTRL_INP_HSYNC_POL;
|
||||
|
||||
if (pvi->next_bridge->timings)
|
||||
bus_flags = pvi->next_bridge->timings->input_bus_flags;
|
||||
if (pvi->bridge.next_bridge->timings)
|
||||
bus_flags = pvi->bridge.next_bridge->timings->input_bus_flags;
|
||||
else if (bridge_state)
|
||||
bus_flags = bridge_state->input_bus_cfg.flags;
|
||||
|
||||
@@ -108,7 +107,7 @@ imx8mp_hdmi_pvi_bridge_get_input_bus_fmts(struct drm_bridge *bridge,
|
||||
unsigned int *num_input_fmts)
|
||||
{
|
||||
struct imx8mp_hdmi_pvi *pvi = to_imx8mp_hdmi_pvi(bridge);
|
||||
struct drm_bridge *next_bridge = pvi->next_bridge;
|
||||
struct drm_bridge *next_bridge = pvi->bridge.next_bridge;
|
||||
struct drm_bridge_state *next_state;
|
||||
|
||||
if (!next_bridge->funcs->atomic_get_input_bus_fmts)
|
||||
@@ -157,10 +156,10 @@ static int imx8mp_hdmi_pvi_probe(struct platform_device *pdev)
|
||||
if (!remote)
|
||||
return -EINVAL;
|
||||
|
||||
pvi->next_bridge = of_drm_find_bridge(remote);
|
||||
pvi->bridge.next_bridge = of_drm_find_and_get_bridge(remote);
|
||||
of_node_put(remote);
|
||||
|
||||
if (!pvi->next_bridge)
|
||||
if (!pvi->bridge.next_bridge)
|
||||
return dev_err_probe(&pdev->dev, -EPROBE_DEFER,
|
||||
"could not find next bridge\n");
|
||||
|
||||
@@ -168,7 +167,7 @@ static int imx8mp_hdmi_pvi_probe(struct platform_device *pdev)
|
||||
|
||||
/* Register the bridge. */
|
||||
pvi->bridge.of_node = pdev->dev.of_node;
|
||||
pvi->bridge.timings = pvi->next_bridge->timings;
|
||||
pvi->bridge.timings = pvi->bridge.next_bridge->timings;
|
||||
|
||||
drm_bridge_add(&pvi->bridge);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user