]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/bridge: stm_lvds: convert to devm_drm_bridge_alloc() API
authorLuca Ceresoli <luca.ceresoli@bootlin.com>
Fri, 9 May 2025 13:53:41 +0000 (15:53 +0200)
committerLuca Ceresoli <luca.ceresoli@bootlin.com>
Wed, 21 May 2025 11:40:09 +0000 (13:40 +0200)
This is the new API for allocating DRM bridges.

Acked-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: Anusha Srivatsa <asrivats@redhat.com>
Link: https://lore.kernel.org/r/20250509-drm-bridge-convert-to-alloc-api-v3-15-b8bc1f16d7aa@bootlin.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
drivers/gpu/drm/stm/lvds.c

index a3ae9a93ce6670eb2c4dd36b3e572fcbca791a1c..07788e8d3d8302a3951e97d64736b721033998d3 100644 (file)
@@ -1049,9 +1049,9 @@ static int lvds_probe(struct platform_device *pdev)
 
        dev_dbg(dev, "Probing LVDS driver...\n");
 
-       lvds = devm_kzalloc(dev, sizeof(*lvds), GFP_KERNEL);
-       if (!lvds)
-               return -ENOMEM;
+       lvds = devm_drm_bridge_alloc(dev, struct stm_lvds, lvds_bridge, &lvds_bridge_funcs);
+       if (IS_ERR(lvds))
+               return PTR_ERR(lvds);
 
        lvds->dev = dev;
 
@@ -1164,7 +1164,6 @@ static int lvds_probe(struct platform_device *pdev)
                goto err_lvds_probe;
        }
 
-       lvds->lvds_bridge.funcs = &lvds_bridge_funcs;
        lvds->lvds_bridge.of_node = dev->of_node;
        lvds->hw_version = lvds_read(lvds, LVDS_VERR);