]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/bridge: analogix-anx6345: convert to devm_drm_bridge_alloc() API
authorLuca Ceresoli <luca.ceresoli@bootlin.com>
Thu, 24 Apr 2025 18:59:10 +0000 (20:59 +0200)
committerLouis Chauvet <louis.chauvet@bootlin.com>
Tue, 29 Apr 2025 09:21:20 +0000 (11:21 +0200)
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>
drivers/gpu/drm/bridge/analogix/analogix-anx6345.c

index f2bafa6cf77956ecafc87aae3a2b6890bdb36cfa..f3fe47b12edca1f92ddd306d152be144df5649b5 100644 (file)
@@ -664,9 +664,10 @@ static int anx6345_i2c_probe(struct i2c_client *client)
        struct device *dev;
        int i, err;
 
-       anx6345 = devm_kzalloc(&client->dev, sizeof(*anx6345), GFP_KERNEL);
-       if (!anx6345)
-               return -ENOMEM;
+       anx6345 = devm_drm_bridge_alloc(&client->dev, struct anx6345, bridge,
+                                       &anx6345_bridge_funcs);
+       if (IS_ERR(anx6345))
+               return PTR_ERR(anx6345);
 
        mutex_init(&anx6345->lock);
 
@@ -738,7 +739,6 @@ static int anx6345_i2c_probe(struct i2c_client *client)
        /* Look for supported chip ID */
        anx6345_poweron(anx6345);
        if (anx6345_get_chip_id(anx6345)) {
-               anx6345->bridge.funcs = &anx6345_bridge_funcs;
                drm_bridge_add(&anx6345->bridge);
 
                return 0;