@@ -186,14 +186,13 @@ clock_recovery_voltage_step(struct intel_dp *intel_dp)
break;
/* Check to see if we've tried the same voltage 5 times */
- if (intel_dp_get_train_voltage(intel_dp) == voltage) {
- ++voltage_tries;
- if (voltage_tries == 5) {
- DRM_ERROR("too many voltage retries, give up\n");
- break;
- }
- } else
+ if (intel_dp_get_train_voltage(intel_dp) != voltage) {
voltage_tries = 0;
+ } else if (++voltage_tries == 5) {
+ DRM_ERROR("too many voltage retries, give up\n");
+ break;
+ }
+
voltage = intel_dp_get_train_voltage(intel_dp);
/* Update training set as requested by target */
It makes it slightly easier to read. Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> --- drivers/gpu/drm/i915/intel_dp_link_training.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)