[PATCH 4/4] drm/i915/fb: return proper error codes instead of magic -1

Jani Nikula jani.nikula at intel.com
Wed Apr 24 11:11:01 UTC 2024


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 at intel.com>
---
 drivers/gpu/drm/i915/display/intel_fb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c
index 86b443433e8b..705f97ef677b 100644
--- a/drivers/gpu/drm/i915/display/intel_fb.c
+++ b/drivers/gpu/drm/i915/display/intel_fb.c
@@ -563,15 +563,15 @@ static bool intel_fb_is_gen12_ccs_aux_plane(const struct drm_framebuffer *fb, in
  * @fb: Framebuffer
  *
  * Returns:
- * Returns the index of the color clear plane for @fb, or -1 if @fb is not a
- * framebuffer using a render compression/color clear modifier.
+ * Returns the index of the color clear plane for @fb, or -EINVAL if @fb is not
+ * a framebuffer using a render compression/color clear modifier.
  */
 int intel_fb_rc_ccs_cc_plane(const struct drm_framebuffer *fb)
 {
 	const struct intel_modifier_desc *md = lookup_modifier(fb->modifier);
 
 	if (!md->ccs.cc_planes)
-		return -1;
+		return -EINVAL;
 
 	drm_WARN_ON_ONCE(fb->dev, hweight8(md->ccs.cc_planes) > 1);
 
-- 
2.39.2



More information about the Intel-gfx mailing list