[PATCH 07/26] drm/bridge: ite-it66121: use devm_drm_of_find_bridge() to put the next bridge

Luca Ceresoli posted 26 patches 1 week, 5 days ago
There is a newer version of this series
[PATCH 07/26] drm/bridge: ite-it66121: use devm_drm_of_find_bridge() to put the next bridge
Posted by Luca Ceresoli 1 week, 5 days ago
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 devm_drm_of_find_bridge() which puts the bridge
reference on remove or on probe failure.

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
---
 drivers/gpu/drm/bridge/ite-it66121.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/ite-it66121.c
index aa7b1dcc5d70..5bc4e5afb823 100644
--- a/drivers/gpu/drm/bridge/ite-it66121.c
+++ b/drivers/gpu/drm/bridge/ite-it66121.c
@@ -1542,7 +1542,7 @@ static int it66121_probe(struct i2c_client *client)
 		return -EINVAL;
 	}
 
-	ctx->next_bridge = of_drm_find_bridge(ep);
+	ctx->next_bridge = devm_drm_of_find_bridge(dev, ep);
 	of_node_put(ep);
 	if (!ctx->next_bridge) {
 		dev_dbg(ctx->dev, "Next bridge not found, deferring probe\n");

-- 
2.51.1
Re: [PATCH 07/26] drm/bridge: ite-it66121: use devm_drm_of_find_bridge() to put the next bridge
Posted by Louis Chauvet 1 week, 5 days ago

On 11/19/25 13:05, Luca Ceresoli wrote:
> 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 devm_drm_of_find_bridge() which puts the bridge
> reference on remove or on probe failure.
> 
> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
> ---
>   drivers/gpu/drm/bridge/ite-it66121.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/ite-it66121.c
> index aa7b1dcc5d70..5bc4e5afb823 100644
> --- a/drivers/gpu/drm/bridge/ite-it66121.c
> +++ b/drivers/gpu/drm/bridge/ite-it66121.c
> @@ -1542,7 +1542,7 @@ static int it66121_probe(struct i2c_client *client)
>   		return -EINVAL;
>   	}
>   
> -	ctx->next_bridge = of_drm_find_bridge(ep);
> +	ctx->next_bridge = devm_drm_of_find_bridge(dev, ep);
>   	of_node_put(ep);
>   	if (!ctx->next_bridge) {

And for all the patches converting of_drm_find_bridge to 
devm_drm_of_find_bridge, I think the pattern:

	bridge = devm_drm_of_find_bridge(dev, ep);
	if(!bridge)
		return -E...;

is wrong, because devm_drm_of_find_bridge can return a non-null error code.


>   		dev_dbg(ctx->dev, "Next bridge not found, deferring probe\n");
>