aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/i915/intel_pipe_crc.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/gpu/drm/i915/intel_pipe_crc.c b/drivers/gpu/drm/i915/intel_pipe_crc.c
index 4f367c16e9e5..39a4e4edda07 100644
--- a/drivers/gpu/drm/i915/intel_pipe_crc.c
+++ b/drivers/gpu/drm/i915/intel_pipe_crc.c
@@ -766,13 +766,12 @@ display_crc_ctl_parse_object(const char *buf, enum intel_pipe_crc_object *o)
766{ 766{
767 int i; 767 int i;
768 768
769 for (i = 0; i < ARRAY_SIZE(pipe_crc_objects); i++) 769 i = match_string(pipe_crc_objects, ARRAY_SIZE(pipe_crc_objects), buf);
770 if (!strcmp(buf, pipe_crc_objects[i])) { 770 if (i < 0)
771 *o = i; 771 return i;
772 return 0;
773 }
774 772
775 return -EINVAL; 773 *o = i;
774 return 0;
776} 775}
777 776
778static int display_crc_ctl_parse_pipe(struct drm_i915_private *dev_priv, 777static int display_crc_ctl_parse_pipe(struct drm_i915_private *dev_priv,
@@ -798,13 +797,12 @@ display_crc_ctl_parse_source(const char *buf, enum intel_pipe_crc_source *s)
798 return 0; 797 return 0;
799 } 798 }
800 799
801 for (i = 0; i < ARRAY_SIZE(pipe_crc_sources); i++) 800 i = match_string(pipe_crc_sources, ARRAY_SIZE(pipe_crc_sources), buf);
802 if (!strcmp(buf, pipe_crc_sources[i])) { 801 if (i < 0)
803 *s = i; 802 return i;
804 return 0;
805 }
806 803
807 return -EINVAL; 804 *s = i;
805 return 0;
808} 806}
809 807
810static int display_crc_ctl_parse(struct drm_i915_private *dev_priv, 808static int display_crc_ctl_parse(struct drm_i915_private *dev_priv,