Commit 76c0b99d authored by Sakari Ailus's avatar Sakari Ailus Committed by Hans Verkuil
Browse files

media: v4l: subdev: Clear frame descriptor before get_frame_desc



Clear frame descriptor before calling transmitter's get_frame_desc() op.
Also remove the corresponding memset() calls from drivers.

Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent 07d81b50
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -362,8 +362,6 @@ static int ub913_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad,
	if (ret)
		return ret;

	memset(fd, 0, sizeof(*fd));

	fd->type = V4L2_MBUS_FRAME_DESC_TYPE_PARALLEL;

	state = v4l2_subdev_lock_and_get_active_state(sd);
+0 −2
Original line number Diff line number Diff line
@@ -499,8 +499,6 @@ static int ub953_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad,
	if (ret)
		return ret;

	memset(fd, 0, sizeof(*fd));

	fd->type = V4L2_MBUS_FRAME_DESC_TYPE_CSI2;

	state = v4l2_subdev_lock_and_get_active_state(sd);
+0 −2
Original line number Diff line number Diff line
@@ -2786,8 +2786,6 @@ static int ub960_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad,
	if (!ub960_pad_is_source(priv, pad))
		return -EINVAL;

	memset(fd, 0, sizeof(*fd));

	fd->type = V4L2_MBUS_FRAME_DESC_TYPE_CSI2;

	state = v4l2_subdev_lock_and_get_active_state(&priv->sd);
+0 −2
Original line number Diff line number Diff line
@@ -1114,8 +1114,6 @@ static int mipi_csis_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad,
	fd->type = V4L2_MBUS_FRAME_DESC_TYPE_PARALLEL;
	fd->num_entries = 1;

	memset(entry, 0, sizeof(*entry));

	entry->flags = 0;
	entry->pixelcode = csis_fmt->code;
	entry->bus.csi2.vc = 0;
+9 −0
Original line number Diff line number Diff line
@@ -306,6 +306,14 @@ static int call_set_selection(struct v4l2_subdev *sd,
	       sd->ops->pad->set_selection(sd, state, sel);
}

static int call_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad,
			       struct v4l2_mbus_frame_desc *fd)
{
	memset(fd, 0, sizeof(*fd));

	return sd->ops->pad->get_frame_desc(sd, pad, fd);
}

static inline int check_edid(struct v4l2_subdev *sd,
			     struct v4l2_subdev_edid *edid)
{
@@ -446,6 +454,7 @@ static const struct v4l2_subdev_pad_ops v4l2_subdev_call_pad_wrappers = {
	.set_edid		= call_set_edid,
	.dv_timings_cap		= call_dv_timings_cap,
	.enum_dv_timings	= call_enum_dv_timings,
	.get_frame_desc		= call_get_frame_desc,
	.get_mbus_config	= call_get_mbus_config,
};