Skip to content

Commit

Permalink
drm/i915: Polish intel_tv_mode_valid()
Browse files Browse the repository at this point in the history
Drop the tv_mode NULL check since intel_tv_mode_find() never
actually returns NULL, and flip the condition around so that
the MODE_OK case is at the end, which is customary to all
the other .mode_valid() implementations.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191001154629.11063-2-ville.syrjala@linux.intel.com
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
  • Loading branch information
Ville Syrjälä committed Oct 2, 2019
1 parent 74f1d78 commit 15de088
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/gpu/drm/i915/display/intel_tv.c
Original file line number Diff line number Diff line change
Expand Up @@ -961,11 +961,10 @@ intel_tv_mode_valid(struct drm_connector *connector,
return MODE_CLOCK_HIGH;

/* Ensure TV refresh is close to desired refresh */
if (tv_mode && abs(tv_mode->refresh - drm_mode_vrefresh(mode) * 1000)
< 1000)
return MODE_OK;
if (abs(tv_mode->refresh - drm_mode_vrefresh(mode) * 1000) >= 1000)
return MODE_CLOCK_RANGE;

return MODE_CLOCK_RANGE;
return MODE_OK;
}

static int
Expand Down

0 comments on commit 15de088

Please sign in to comment.