]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/bridge: anx7625: convert to devm_drm_bridge_alloc() API
authorLuca Ceresoli <luca.ceresoli@bootlin.com>
Fri, 9 May 2025 13:53:29 +0000 (15:53 +0200)
committerLuca Ceresoli <luca.ceresoli@bootlin.com>
Wed, 21 May 2025 11:40:08 +0000 (13:40 +0200)
This is the new API for allocating DRM bridges.

Acked-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: Anusha Srivatsa <asrivats@redhat.com>
Link: https://lore.kernel.org/r/20250509-drm-bridge-convert-to-alloc-api-v3-3-b8bc1f16d7aa@bootlin.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
drivers/gpu/drm/bridge/analogix/anx7625.c

index 8a9079c2ed5c22565d0733ef899119e347947d21..0ac4a82c5a6e5e665d913674b664905a96c0d8e6 100644 (file)
@@ -2596,7 +2596,6 @@ static int anx7625_link_bridge(struct drm_dp_aux *aux)
                return ret;
        }
 
-       platform->bridge.funcs = &anx7625_bridge_funcs;
        platform->bridge.of_node = dev->of_node;
        if (!anx7625_of_panel_on_aux_bus(dev))
                platform->bridge.ops |= DRM_BRIDGE_OP_EDID;
@@ -2630,10 +2629,10 @@ static int anx7625_i2c_probe(struct i2c_client *client)
                return -ENODEV;
        }
 
-       platform = devm_kzalloc(dev, sizeof(*platform), GFP_KERNEL);
-       if (!platform) {
+       platform = devm_drm_bridge_alloc(dev, struct anx7625_data, bridge, &anx7625_bridge_funcs);
+       if (IS_ERR(platform)) {
                DRM_DEV_ERROR(dev, "fail to allocate driver data\n");
-               return -ENOMEM;
+               return PTR_ERR(platform);
        }
 
        pdata = &platform->pdata;