summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2023-10-27 12:16:43 +0300
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2023-12-04 13:21:46 +0300
commit9641e8019ae8349c7a487e5165469240257410cd (patch)
tree1b9256f48e6519d912d54c9492d7d5f7b4d1b326 /drivers/media
parent6a6e49f89297cdf2c8c4deec54395179643b4a05 (diff)
downloadlinux-9641e8019ae8349c7a487e5165469240257410cd.tar.xz
media: microchip-isc: Remove dead code in pipeline validation
The isc_try_fse() function, called from isc_validate(), takes two parameters, an isc_device pointer, and a v4l2_subdev_state pointer. The isc_device is accessed but not modified by the function. The state is modified, including the struct v4l2_subdev_pad_config array it points to, but they are then never used by the caller. Furthermore, the V4L2 subdev operation called by isc_try_fse() doesn't modify the subdev it is called on. The isc_try_fse() function has thus no effect, and can just be dropped. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Eugen Hristev <eugen.hristev@collabora.com> Tested-by: Eugen Hristev <eugen.hristev@collabora.com> [Sakari Ailus: Resolve conflicts due to API changes.] Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/microchip/microchip-isc-base.c41
1 files changed, 0 insertions, 41 deletions
diff --git a/drivers/media/platform/microchip/microchip-isc-base.c b/drivers/media/platform/microchip/microchip-isc-base.c
index 3fba0e2844b6..540cb1378289 100644
--- a/drivers/media/platform/microchip/microchip-isc-base.c
+++ b/drivers/media/platform/microchip/microchip-isc-base.c
@@ -851,40 +851,6 @@ static int isc_try_configure_pipeline(struct isc_device *isc)
return 0;
}
-static void isc_try_fse(struct isc_device *isc,
- struct v4l2_subdev_state *sd_state)
-{
- struct v4l2_rect *try_crop =
- v4l2_subdev_state_get_crop(sd_state, 0);
- struct v4l2_subdev_frame_size_enum fse = {
- .which = V4L2_SUBDEV_FORMAT_TRY,
- };
- int ret;
-
- /*
- * If we do not know yet which format the subdev is using, we cannot
- * do anything.
- */
- if (!isc->config.sd_format)
- return;
-
- fse.code = isc->try_config.sd_format->mbus_code;
-
- ret = v4l2_subdev_call(isc->current_subdev->sd, pad, enum_frame_size,
- sd_state, &fse);
- /*
- * Attempt to obtain format size from subdev. If not available,
- * just use the maximum ISC can receive.
- */
- if (ret) {
- try_crop->width = isc->max_width;
- try_crop->height = isc->max_height;
- } else {
- try_crop->width = fse.max_width;
- try_crop->height = fse.max_height;
- }
-}
-
static int isc_try_fmt(struct isc_device *isc, struct v4l2_format *f)
{
struct v4l2_pix_format *pixfmt = &f->fmt.pix;
@@ -946,10 +912,6 @@ static int isc_validate(struct isc_device *isc)
.which = V4L2_SUBDEV_FORMAT_ACTIVE,
.pad = isc->remote_pad,
};
- struct v4l2_subdev_pad_config pad_cfg = {};
- struct v4l2_subdev_state pad_state = {
- .pads = &pad_cfg,
- };
/* Get current format from subdev */
ret = v4l2_subdev_call(isc->current_subdev->sd, pad, get_fmt, NULL,
@@ -1010,9 +972,6 @@ static int isc_validate(struct isc_device *isc)
if (ret)
return ret;
- /* Obtain frame sizes if possible to have crop requirements ready */
- isc_try_fse(isc, &pad_state);
-
/* Configure ISC pipeline for the config */
ret = isc_try_configure_pipeline(isc);
if (ret)