drm/vc4: dsi: Switch to drmm_of_get_bridge
authorMaxime Ripard <maxime@cerno.tech>
Wed, 11 May 2022 14:08:44 +0000 (16:08 +0200)
committerMaxime Ripard <maxime@cerno.tech>
Wed, 7 Sep 2022 08:53:03 +0000 (10:53 +0200)
The current code uses a device-managed function to retrieve the next bridge
downstream.

However, that means that it will be removed at unbind time, where the DRM
device is still very much live and might still have some applications that
still have it open.

Switch to a DRM-managed variant to clean everything up once the DRM device
has been last closed.

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
drivers/gpu/drm/vc4/vc4_dsi.c

index e19b3a7..0763e6a 100644 (file)
@@ -1719,7 +1719,7 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data)
                return ret;
        }
 
-       dsi->out_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0, 0);
+       dsi->out_bridge = drmm_of_get_bridge(drm, dev->of_node, 0, 0);
        if (IS_ERR(dsi->out_bridge))
                return PTR_ERR(dsi->out_bridge);