Skip to content

Commit

Permalink
media: video-i2c: use V4L2_FRACT_COMPARE
Browse files Browse the repository at this point in the history
Use V4L2_FRACT_COMPARE to check whether two v4l2_fract structs are equal.

Cc: Matt Ranostay <[email protected]>
Cc: Sakari Ailus <[email protected]>
Cc: Hans Verkuil <[email protected]>
Signed-off-by: Akinobu Mita <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
mita authored and mchehab committed Jun 21, 2019
1 parent eef4d8e commit 94954bb
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/media/i2c/video-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,8 @@ static int mlx90640_setup(struct video_i2c_data *data)
unsigned int n, idx;

for (n = 0; n < data->chip->num_frame_intervals - 1; n++) {
if (data->frame_interval.numerator
!= data->chip->frame_intervals[n].numerator)
continue;

if (data->frame_interval.denominator
== data->chip->frame_intervals[n].denominator)
if (V4L2_FRACT_COMPARE(data->frame_interval, ==,
data->chip->frame_intervals[n]))
break;
}

Expand Down

0 comments on commit 94954bb

Please sign in to comment.