Skip to content

Commit 53ddeb2

Browse files
lucaceresoliFomys
authored andcommitted
drm/bridge: analogix-anx6345: convert to devm_drm_bridge_alloc() API
This is the new API for allocating DRM bridges. Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Andy Yan <andyshrk@163.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250424-drm-bridge-convert-to-alloc-api-v2-3-8f91a404d86b@bootlin.com Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
1 parent 411465d commit 53ddeb2

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/gpu/drm/bridge/analogix/analogix-anx6345.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -664,9 +664,10 @@ static int anx6345_i2c_probe(struct i2c_client *client)
664664
struct device *dev;
665665
int i, err;
666666

667-
anx6345 = devm_kzalloc(&client->dev, sizeof(*anx6345), GFP_KERNEL);
668-
if (!anx6345)
669-
return -ENOMEM;
667+
anx6345 = devm_drm_bridge_alloc(&client->dev, struct anx6345, bridge,
668+
&anx6345_bridge_funcs);
669+
if (IS_ERR(anx6345))
670+
return PTR_ERR(anx6345);
670671

671672
mutex_init(&anx6345->lock);
672673

@@ -738,7 +739,6 @@ static int anx6345_i2c_probe(struct i2c_client *client)
738739
/* Look for supported chip ID */
739740
anx6345_poweron(anx6345);
740741
if (anx6345_get_chip_id(anx6345)) {
741-
anx6345->bridge.funcs = &anx6345_bridge_funcs;
742742
drm_bridge_add(&anx6345->bridge);
743743

744744
return 0;

0 commit comments

Comments
 (0)