@@ -600,7 +600,7 @@ static int intersect_rates(const int *source_rates, int source_len,
return k;
}
-/* return index of rate in rates array, or -1 if not found */
+/* return index of rate in rates array, or -ENOENT if not found */
static int intel_dp_rate_index(const int *rates, int len, int rate)
{
int i;
@@ -609,7 +609,7 @@ static int intel_dp_rate_index(const int *rates, int len, int rate)
if (rate == rates[i])
return i;
- return -1;
+ return -ENOENT;
}
static void intel_dp_set_common_rates(struct intel_dp *intel_dp)
@@ -680,7 +680,7 @@ int intel_dp_get_link_train_fallback_values(struct intel_dp *intel_dp,
*/
if (intel_dp->is_mst) {
drm_err(&i915->drm, "Link Training Unsuccessful\n");
- return -1;
+ return -EINVAL;
}
if (intel_dp_is_edp(intel_dp) && !intel_dp->use_max_params) {
@@ -717,7 +717,7 @@ int intel_dp_get_link_train_fallback_values(struct intel_dp *intel_dp,
intel_dp->max_link_lane_count = lane_count >> 1;
} else {
drm_err(&i915->drm, "Link Training Unsuccessful\n");
- return -1;
+ return -EINVAL;
}
return 0;
Use proper negative error codes intead of magic -1. Don't set a bad example, as -1 is -EPERM. Signed-off-by: Jani Nikula <jani.nikula@intel.com> --- drivers/gpu/drm/i915/display/intel_dp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)