From: Luca Ceresoli Date: Thu, 24 Apr 2025 18:59:09 +0000 (+0200) Subject: platform: arm64: acer-aspire1-ec: convert to devm_drm_bridge_alloc() API X-Git-Tag: v6.16-rc1~144^2~16^2~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=411465d35bc56877c33e2498ac697acfcf484e6b;p=thirdparty%2Flinux.git platform: arm64: acer-aspire1-ec: convert to devm_drm_bridge_alloc() API This is the new API for allocating DRM bridges. Acked-by: Ilpo Järvinen Signed-off-by: Luca Ceresoli Link: https://patchwork.freedesktop.org/patch/msgid/20250424-drm-bridge-convert-to-alloc-api-v2-2-8f91a404d86b@bootlin.com Signed-off-by: Louis Chauvet --- diff --git a/drivers/platform/arm64/acer-aspire1-ec.c b/drivers/platform/arm64/acer-aspire1-ec.c index 958fe1bf5f85b..438532a047e68 100644 --- a/drivers/platform/arm64/acer-aspire1-ec.c +++ b/drivers/platform/arm64/acer-aspire1-ec.c @@ -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;