Commit fd17e3a9 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab
Browse files

media: i2c: Use accessors for pad config 'try_*' fields



The 'try_*' fields of the v4l2_subdev_pad_config structure are meant to
be accessed through helper functions. Replace direct access with usage
of the v4l2_subdev_get_pad_format(), v4l2_subdev_get_pad_crop() and
v4l2_subdev_get_pad_compose() helpers.

Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 0623979d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -443,7 +443,7 @@ static int adv7183_set_fmt(struct v4l2_subdev *sd,
	if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE)
		decoder->fmt = *fmt;
	else
		sd_state->pads->try_fmt = *fmt;
		*v4l2_subdev_get_pad_format(sd, sd_state, 0) = *fmt;
	return 0;
}

+6 −6
Original line number Diff line number Diff line
@@ -1018,8 +1018,8 @@ static int __imx274_change_compose(struct stimx274 *imx274,
	int best_goodness = INT_MIN;

	if (which == V4L2_SUBDEV_FORMAT_TRY) {
		cur_crop = &sd_state->pads->try_crop;
		tgt_fmt = &sd_state->pads->try_fmt;
		cur_crop = v4l2_subdev_get_pad_crop(&imx274->sd, sd_state, 0);
		tgt_fmt = v4l2_subdev_get_pad_format(&imx274->sd, sd_state, 0);
	} else {
		cur_crop = &imx274->crop;
		tgt_fmt = &imx274->format;
@@ -1112,7 +1112,7 @@ static int imx274_set_fmt(struct v4l2_subdev *sd,
	 */
	fmt->field = V4L2_FIELD_NONE;
	if (format->which == V4L2_SUBDEV_FORMAT_TRY)
		sd_state->pads->try_fmt = *fmt;
		*v4l2_subdev_get_pad_format(sd, sd_state, 0) = *fmt;
	else
		imx274->format = *fmt;

@@ -1143,8 +1143,8 @@ static int imx274_get_selection(struct v4l2_subdev *sd,
	}

	if (sel->which == V4L2_SUBDEV_FORMAT_TRY) {
		src_crop = &sd_state->pads->try_crop;
		src_fmt = &sd_state->pads->try_fmt;
		src_crop = v4l2_subdev_get_pad_crop(sd, sd_state, 0);
		src_fmt = v4l2_subdev_get_pad_format(sd, sd_state, 0);
	} else {
		src_crop = &imx274->crop;
		src_fmt = &imx274->format;
@@ -1215,7 +1215,7 @@ static int imx274_set_selection_crop(struct stimx274 *imx274,
	sel->r = new_crop;

	if (sel->which == V4L2_SUBDEV_FORMAT_TRY)
		tgt_crop = &sd_state->pads->try_crop;
		tgt_crop = v4l2_subdev_get_pad_crop(&imx274->sd, sd_state, 0);
	else
		tgt_crop = &imx274->crop;

+1 −1
Original line number Diff line number Diff line
@@ -405,7 +405,7 @@ static int mt9m001_set_fmt(struct v4l2_subdev *sd,

	if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE)
		return mt9m001_s_fmt(sd, fmt, mf);
	sd_state->pads->try_fmt = *mf;
	*v4l2_subdev_get_pad_format(sd, sd_state, 0) = *mf;
	return 0;
}

+1 −1
Original line number Diff line number Diff line
@@ -671,7 +671,7 @@ static int mt9m111_set_fmt(struct v4l2_subdev *sd,
	mf->xfer_func	= V4L2_XFER_FUNC_DEFAULT;

	if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
		sd_state->pads->try_fmt = *mf;
		*v4l2_subdev_get_pad_format(sd, sd_state, 0) = *mf;
		return 0;
	}

+1 −1
Original line number Diff line number Diff line
@@ -982,7 +982,7 @@ static int mt9t112_set_fmt(struct v4l2_subdev *sd,

	if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE)
		return mt9t112_s_fmt(sd, mf);
	sd_state->pads->try_fmt = *mf;
	*v4l2_subdev_get_pad_format(sd, sd_state, 0) = *mf;

	return 0;
}
Loading