platform: arm64: acer-aspire1-ec: convert to devm_drm_bridge_alloc() API
authorLuca Ceresoli <luca.ceresoli@bootlin.com>
Thu, 24 Apr 2025 18:59:09 +0000 (20:59 +0200)
committerLouis Chauvet <louis.chauvet@bootlin.com>
Tue, 29 Apr 2025 09:21:19 +0000 (11:21 +0200)
This is the new API for allocating DRM bridges.

Acked-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250424-drm-bridge-convert-to-alloc-api-v2-2-8f91a404d86b@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
drivers/platform/arm64/acer-aspire1-ec.c

index 958fe1bf5f85bb69ac7962f217de9f0b40cde9a1..438532a047e68799ac53a16a4c813fc16be997b9 100644 (file)
@@ -452,9 +452,9 @@ static int aspire_ec_probe(struct i2c_client *client)
        int ret;
        u8 tmp;
 
-       ec = devm_kzalloc(dev, sizeof(*ec), GFP_KERNEL);
-       if (!ec)
-               return -ENOMEM;
+       ec = devm_drm_bridge_alloc(dev, struct aspire_ec, bridge, &aspire_ec_bridge_funcs);
+       if (IS_ERR(ec))
+               return PTR_ERR(ec);
 
        ec->client = client;
        i2c_set_clientdata(client, ec);
@@ -497,7 +497,6 @@ static int aspire_ec_probe(struct i2c_client *client)
        fwnode = device_get_named_child_node(dev, "connector");
        if (fwnode) {
                INIT_WORK(&ec->work, aspire_ec_bridge_update_hpd_work);
-               ec->bridge.funcs = &aspire_ec_bridge_funcs;
                ec->bridge.of_node = to_of_node(fwnode);
                ec->bridge.ops = DRM_BRIDGE_OP_HPD;
                ec->bridge.type = DRM_MODE_CONNECTOR_USB;