diff options
| author | Luca Ceresoli <luca.ceresoli@bootlin.com> | 2026-05-11 19:40:11 +0300 |
|---|---|---|
| committer | Luca Ceresoli <luca.ceresoli@bootlin.com> | 2026-05-19 11:57:26 +0300 |
| commit | cd9517f6e2093a4579f8a37ca66214eb34e9cd04 (patch) | |
| tree | aebecea15e64fa5dec53071cad0dc2bcab27795e | |
| parent | 91b42aa55c7777545e528bbd991fadea5c561d46 (diff) | |
| download | linux-cd9517f6e2093a4579f8a37ca66214eb34e9cd04.tar.xz | |
drm/bridge: lt9611: switch to of_drm_get_bridge_by_endpoint()
This driver calls drm_of_find_panel_or_bridge() with a NULL pointer in the
@panel parameter, thus using a reduced feature set of that function.
Replace this call with the simpler of_drm_get_bridge_by_endpoint().
Since of_drm_get_bridge_by_endpoint() increases the refcount of the
returned bridge, ensure it is put on removal. To achieve this, instead of
adding an explicit drm_bridge_put(), migrate to the bridge::next_bridge
pointer which is automatically put when the bridge is eventually freed.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://patch.msgid.link/20260511-drm-bridge-alloc-getput-panel_or_bridge-v6-7-f61c9e498b3f@bootlin.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
| -rw-r--r-- | drivers/gpu/drm/bridge/lontium-lt9611.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gpu/drm/bridge/lontium-lt9611.c b/drivers/gpu/drm/bridge/lontium-lt9611.c index 0f49b13193b9..21305296e111 100644 --- a/drivers/gpu/drm/bridge/lontium-lt9611.c +++ b/drivers/gpu/drm/bridge/lontium-lt9611.c @@ -37,7 +37,6 @@ struct lt9611 { struct device *dev; struct drm_bridge bridge; - struct drm_bridge *next_bridge; struct regmap *regmap; @@ -761,7 +760,7 @@ static int lt9611_bridge_attach(struct drm_bridge *bridge, { struct lt9611 *lt9611 = bridge_to_lt9611(bridge); - return drm_bridge_attach(encoder, lt9611->next_bridge, + return drm_bridge_attach(encoder, lt9611->bridge.next_bridge, bridge, flags); } @@ -1058,7 +1057,11 @@ static int lt9611_parse_dt(struct device *dev, lt9611->ac_mode = of_property_read_bool(dev->of_node, "lt,ac-mode"); - return drm_of_find_panel_or_bridge(dev->of_node, 2, -1, NULL, <9611->next_bridge); + lt9611->bridge.next_bridge = of_drm_get_bridge_by_endpoint(dev->of_node, 2, -1); + if (IS_ERR(lt9611->bridge.next_bridge)) + return PTR_ERR(lt9611->bridge.next_bridge); + + return 0; } static int lt9611_gpio_init(struct lt9611 *lt9611) |
