Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/bridge: ite-it66121: 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: Maxime Ripard <mripard@kernel.org>
Link: https://patch.msgid.link/20251216-drm-bridge-alloc-getput-drm_of_find_bridge-v3-7-b5165fab8058@bootlin.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

+3 -4
+3 -4
drivers/gpu/drm/bridge/ite-it66121.c
··· 298 298 struct it66121_ctx { 299 299 struct regmap *regmap; 300 300 struct drm_bridge bridge; 301 - struct drm_bridge *next_bridge; 302 301 struct drm_connector *connector; 303 302 struct device *dev; 304 303 struct gpio_desc *gpio_reset; ··· 595 596 if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) 596 597 return -EINVAL; 597 598 598 - ret = drm_bridge_attach(encoder, ctx->next_bridge, bridge, flags); 599 + ret = drm_bridge_attach(encoder, ctx->bridge.next_bridge, bridge, flags); 599 600 if (ret) 600 601 return ret; 601 602 ··· 1542 1543 return -EINVAL; 1543 1544 } 1544 1545 1545 - ctx->next_bridge = of_drm_find_bridge(ep); 1546 + ctx->bridge.next_bridge = of_drm_find_and_get_bridge(ep); 1546 1547 of_node_put(ep); 1547 - if (!ctx->next_bridge) { 1548 + if (!ctx->bridge.next_bridge) { 1548 1549 dev_dbg(ctx->dev, "Next bridge not found, deferring probe\n"); 1549 1550 return -EPROBE_DEFER; 1550 1551 }