Commit 0b7510d1 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/tilcdc: Use drm_connector_has_possible_encoder()

Use drm_connector_has_possible_encoder() for checking
whether the encoder has an associated connector.

v2: Replace the drm_for_each_connector_encoder_ids() loop
    with a simple drm_connector_has_possible_encoder() call

Cc: Jyri Sarha <jsarha@ti.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180628131315.14156-10-ville.syrjala@linux.intel.comReviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Acked-by: default avatarJyri Sarha <jsarha@ti.com>
parent f8222409
...@@ -103,12 +103,11 @@ struct drm_connector *tilcdc_encoder_find_connector(struct drm_device *ddev, ...@@ -103,12 +103,11 @@ struct drm_connector *tilcdc_encoder_find_connector(struct drm_device *ddev,
struct drm_encoder *encoder) struct drm_encoder *encoder)
{ {
struct drm_connector *connector; struct drm_connector *connector;
int i;
list_for_each_entry(connector, &ddev->mode_config.connector_list, head) list_for_each_entry(connector, &ddev->mode_config.connector_list, head) {
for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++) if (drm_connector_has_possible_encoder(connector, encoder))
if (connector->encoder_ids[i] == encoder->base.id) return connector;
return connector; }
dev_err(ddev->dev, "No connector found for %s encoder (id %d)\n", dev_err(ddev->dev, "No connector found for %s encoder (id %d)\n",
encoder->name, encoder->base.id); encoder->name, encoder->base.id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment