Skip to content

Commit

Permalink
drm/i915: Simplify aux_ch_to_digital_port()
Browse files Browse the repository at this point in the history
Just return the correct thing from within the loop to make
the code more readable. We have no ref counts/etc. to deal
with here so no point in breaking from the loop just to return
something.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240223203216.15210-2-ville.syrjala@linux.intel.com
Reviewed-by: Imre Deak <imre.deak@intel.com>
  • Loading branch information
Ville Syrjälä committed Feb 29, 2024
1 parent 6a8c66b commit 12531c8
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions drivers/gpu/drm/i915/display/intel_display_power_well.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,27 +217,22 @@ static struct intel_digital_port *
aux_ch_to_digital_port(struct drm_i915_private *dev_priv,
enum aux_ch aux_ch)
{
struct intel_digital_port *dig_port = NULL;
struct intel_encoder *encoder;

for_each_intel_encoder(&dev_priv->drm, encoder) {
struct intel_digital_port *dig_port;

/* We'll check the MST primary port */
if (encoder->type == INTEL_OUTPUT_DP_MST)
continue;

dig_port = enc_to_dig_port(encoder);
if (!dig_port)
continue;

if (dig_port->aux_ch != aux_ch) {
dig_port = NULL;
continue;
}

break;
if (dig_port && dig_port->aux_ch == aux_ch)
return dig_port;
}

return dig_port;
return NULL;
}

static enum phy icl_aux_pw_to_phy(struct drm_i915_private *i915,
Expand Down

0 comments on commit 12531c8

Please sign in to comment.