media: vivid: Use v4l2_find_nearest_size
authorSakari Ailus <sakari.ailus@linux.intel.com>
Thu, 8 Feb 2018 12:00:02 +0000 (07:00 -0500)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 21 Mar 2018 15:20:56 +0000 (11:20 -0400)
Use v4l2_find_nearest_size instead of a driver specific function to find
nearest matching size.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/vivid/vivid-vid-cap.c

index 808967c7b0ab16b53b2791f391dcc73a3cd10db7..01c7036836573a587447c6df61cc955b36d824bf 100644 (file)
@@ -561,9 +561,8 @@ int vivid_try_fmt_vid_cap(struct file *file, void *priv,
        mp->field = vivid_field_cap(dev, mp->field);
        if (vivid_is_webcam(dev)) {
                const struct v4l2_frmsize_discrete *sz =
-                       v4l2_find_nearest_format(webcam_sizes,
-                                                VIVID_WEBCAM_SIZES,
-                                                mp->width, mp->height);
+                       v4l2_find_nearest_size(webcam_sizes, width, height,
+                                              mp->width, mp->height);
 
                w = sz->width;
                h = sz->height;