From 46b3847d7f680d51a29384a5ee9e1d54e6739f5d Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 13 Sep 2018 00:37:35 +0300 Subject: drm/omap: Add a dss device operation flag for .get_modes() Instead of manually iterating over the dss devices in the pipeline to find the first one that implements the .get_modes() operation, add a new operation flag for .get_modes() and use the omap_connector_find_device() helper function to locate the right dss device. Signed-off-by: Laurent Pinchart Reviewed-by: Sebastian Reichel Tested-by: Sebastian Reichel Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/omap_connector.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/drm/omapdrm/omap_connector.c') diff --git a/drivers/gpu/drm/omapdrm/omap_connector.c b/drivers/gpu/drm/omapdrm/omap_connector.c index c0157554c12f..dc4533c8cbb4 100644 --- a/drivers/gpu/drm/omapdrm/omap_connector.c +++ b/drivers/gpu/drm/omapdrm/omap_connector.c @@ -228,10 +228,10 @@ static int omap_connector_get_modes(struct drm_connector *connector) * Otherwise if the display pipeline reports modes (e.g. with a fixed * resolution panel or an analog TV output), query it. */ - for (dssdev = omap_connector->display; dssdev; dssdev = dssdev->src) { - if (dssdev->ops->get_modes) - return dssdev->ops->get_modes(dssdev, connector); - } + dssdev = omap_connector_find_device(connector, + OMAP_DSS_DEVICE_OP_MODES); + if (dssdev) + return dssdev->ops->get_modes(dssdev, connector); /* * We can't retrieve modes, which can happen for instance for a DVI or -- cgit