drm/bridge: ti-sn65dsi86: convert to devm_drm_bridge_alloc() API
authorLuca Ceresoli <luca.ceresoli@bootlin.com>
Thu, 24 Apr 2025 18:59:20 +0000 (20:59 +0200)
committerLouis Chauvet <louis.chauvet@bootlin.com>
Tue, 29 Apr 2025 09:21:22 +0000 (11:21 +0200)
This is the new API for allocating DRM bridges.

Reviewed-by: Herve Codina <herve.codina@bootlin.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Tested-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250424-drm-bridge-convert-to-alloc-api-v2-13-8f91a404d86b@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
drivers/gpu/drm/bridge/ti-sn65dsi86.c

index f72675766e01108d72033b8b83c25d3e4d8fd1a7..60224f476e1d048c693ab36a0a79b6897c6101a8 100644 (file)
@@ -1317,7 +1317,6 @@ static int ti_sn_bridge_probe(struct auxiliary_device *adev,
        if (ret)
                return ret;
 
-       pdata->bridge.funcs = &ti_sn_bridge_funcs;
        pdata->bridge.of_node = np;
        pdata->bridge.type = pdata->next_bridge->type == DRM_MODE_CONNECTOR_DisplayPort
                           ? DRM_MODE_CONNECTOR_DisplayPort : DRM_MODE_CONNECTOR_eDP;
@@ -1907,9 +1906,9 @@ static int ti_sn65dsi86_probe(struct i2c_client *client)
                return -ENODEV;
        }
 
-       pdata = devm_kzalloc(dev, sizeof(struct ti_sn65dsi86), GFP_KERNEL);
-       if (!pdata)
-               return -ENOMEM;
+       pdata = devm_drm_bridge_alloc(dev, struct ti_sn65dsi86, bridge, &ti_sn_bridge_funcs);
+       if (IS_ERR(pdata))
+               return PTR_ERR(pdata);
        dev_set_drvdata(dev, pdata);
        pdata->dev = dev;