mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-02 08:11:32 -04:00
drm/meson: encoder_dsi: 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: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Reviewed-by: Maxime Ripard <mripard@kernel.org> Link: https://patch.msgid.link/20251216-drm-bridge-alloc-getput-drm_of_find_bridge-v3-11-b5165fab8058@bootlin.com Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
This commit is contained in:
@@ -25,7 +25,6 @@
|
||||
struct meson_encoder_dsi {
|
||||
struct drm_encoder encoder;
|
||||
struct drm_bridge bridge;
|
||||
struct drm_bridge *next_bridge;
|
||||
struct meson_drm *priv;
|
||||
};
|
||||
|
||||
@@ -38,7 +37,7 @@ static int meson_encoder_dsi_attach(struct drm_bridge *bridge,
|
||||
{
|
||||
struct meson_encoder_dsi *encoder_dsi = bridge_to_meson_encoder_dsi(bridge);
|
||||
|
||||
return drm_bridge_attach(encoder, encoder_dsi->next_bridge,
|
||||
return drm_bridge_attach(encoder, encoder_dsi->bridge.next_bridge,
|
||||
&encoder_dsi->bridge, flags);
|
||||
}
|
||||
|
||||
@@ -120,8 +119,8 @@ int meson_encoder_dsi_probe(struct meson_drm *priv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
meson_encoder_dsi->next_bridge = of_drm_find_bridge(remote);
|
||||
if (!meson_encoder_dsi->next_bridge)
|
||||
meson_encoder_dsi->bridge.next_bridge = of_drm_find_and_get_bridge(remote);
|
||||
if (!meson_encoder_dsi->bridge.next_bridge)
|
||||
return dev_err_probe(priv->dev, -EPROBE_DEFER,
|
||||
"Failed to find DSI transceiver bridge\n");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user