[PATCH 8/8] drm/tilcdc: Use drm_for_each_connector_encoder_ids()
Ville Syrjala
ville.syrjala at linux.intel.com
Tue Jun 26 17:47:14 UTC 2018
From: Ville Syrjälä <ville.syrjala at linux.intel.com>
Use drm_for_each_connector_encoder_ids() for iterating
connector->encoder_ids[]. A bit more convenient not having
to deal with the implementation details.
Cc: Jyri Sarha <jsarha at ti.com>
Cc: Tomi Valkeinen <tomi.valkeinen at ti.com>
Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
drivers/gpu/drm/tilcdc/tilcdc_external.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_external.c b/drivers/gpu/drm/tilcdc/tilcdc_external.c
index d651bdd6597e..ed8af21e75b0 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_external.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_external.c
@@ -103,11 +103,12 @@ struct drm_connector *tilcdc_encoder_find_connector(struct drm_device *ddev,
struct drm_encoder *encoder)
{
struct drm_connector *connector;
+ u32 encoder_id;
int i;
list_for_each_entry(connector, &ddev->mode_config.connector_list, head)
- for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++)
- if (connector->encoder_ids[i] == encoder->base.id)
+ drm_for_each_connector_encoder_ids(connector, encoder_id, i)
+ if (encoder_id == encoder->base.id)
return connector;
dev_err(ddev->dev, "No connector found for %s encoder (id %d)\n",
--
2.16.4
More information about the dri-devel
mailing list