drm/omap: use drm_for_each_bridge_in_chain_from()

Use drm_for_each_bridge_in_chain_from _scoped() instead of an open-coded
loop based on drm_bridge_get_next_bridge() to ensure the bridge being
looped on is refcounted and simplify the driver code.

Reviewed-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250808-drm-bridge-alloc-getput-for_each_bridge-v2-9-edb6ee81edf1@bootlin.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
This commit is contained in:
Luca Ceresoli 2025-08-08 16:49:16 +02:00
parent 78f4eec620
commit 8e1e17416c

View File

@ -77,7 +77,6 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder,
struct omap_dss_device *output = omap_encoder->output;
struct drm_device *dev = encoder->dev;
struct drm_connector *connector;
struct drm_bridge *bridge;
struct videomode vm = { 0 };
u32 bus_flags;
@ -97,8 +96,7 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder,
*
* A better solution is to use DRM's bus-flags through the whole driver.
*/
for (bridge = output->bridge; bridge;
bridge = drm_bridge_get_next_bridge(bridge)) {
drm_for_each_bridge_in_chain_from(output->bridge, bridge) {
if (!bridge->timings)
continue;