diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2018-02-08 15:00:48 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2018-03-21 18:21:33 +0300 |
commit | 3c91d24fcd89c6b40bc3d4741311bc046456291d (patch) | |
tree | db6bb3089cd3a7a26c013e9a3b73309709650f08 /drivers/media/v4l2-core/v4l2-common.c | |
parent | ac53212880a1af2191fd469dab275b94cd9d13c8 (diff) | |
download | linux-3c91d24fcd89c6b40bc3d4741311bc046456291d.tar.xz |
media: v4l: common: Remove v4l2_find_nearest_format
v4l2_find_nearest_format is not useful for drivers in finding the best
matching format as it assumes a V4L2 specific struct. Drivers will use
v4l2_find_nearest_size instead.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/v4l2-core/v4l2-common.c')
-rw-r--r-- | drivers/media/v4l2-core/v4l2-common.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-core/v4l2-common.c index 9b65529dfaf6..b518b92d6d96 100644 --- a/drivers/media/v4l2-core/v4l2-common.c +++ b/drivers/media/v4l2-core/v4l2-common.c @@ -357,32 +357,6 @@ void v4l_bound_align_image(u32 *w, unsigned int wmin, unsigned int wmax, } EXPORT_SYMBOL_GPL(v4l_bound_align_image); -const struct v4l2_frmsize_discrete * -v4l2_find_nearest_format(const struct v4l2_frmsize_discrete *sizes, - size_t num_sizes, - s32 width, s32 height) -{ - int i; - u32 error, min_error = UINT_MAX; - const struct v4l2_frmsize_discrete *size, *best = NULL; - - if (!sizes) - return NULL; - - for (i = 0, size = sizes; i < num_sizes; i++, size++) { - error = abs(size->width - width) + abs(size->height - height); - if (error < min_error) { - min_error = error; - best = size; - } - if (!error) - break; - } - - return best; -} -EXPORT_SYMBOL_GPL(v4l2_find_nearest_format); - const void * __v4l2_find_nearest_size(const void *array, size_t array_size, size_t entry_size, size_t width_offset, |