From: Luca Ceresoli Date: Fri, 9 May 2025 13:53:29 +0000 (+0200) Subject: drm/bridge: anx7625: convert to devm_drm_bridge_alloc() API X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7a909b2beafbdb0139cb953ce6be4813b6433d1f;p=thirdparty%2Fkernel%2Flinux.git drm/bridge: anx7625: convert to devm_drm_bridge_alloc() API This is the new API for allocating DRM bridges. Acked-by: Maxime Ripard Reviewed-by: Anusha Srivatsa Link: https://lore.kernel.org/r/20250509-drm-bridge-convert-to-alloc-api-v3-3-b8bc1f16d7aa@bootlin.com Signed-off-by: Luca Ceresoli --- diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index 8a9079c2ed5c2..0ac4a82c5a6e5 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -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;