Commit 69d6c6fc authored by Hans de Goede's avatar Hans de Goede Committed by Hans Verkuil
Browse files

media: ov02c10: Remove unnecessary hflip and vflip pointers



The cci_update_bits() inside ov02c10_set_ctrl() can use the passed
data in the ctrl argument to access the vflip control value.

After changing this there is no need to store a pointer to the hflip
and vflip controls inside struct ov02c10, drop these.

Reviewed-by: default avatarBryan O'Donoghue <bod@kernel.org>
Reviewed-by: default avatarSebastian Reichel <sre@kernel.org>
Tested-by: Sebastian Reichel <sre@kernel.org> # T14s Gen6 Snapdragon
Signed-off-by: default avatarHans de Goede <johannes.goede@oss.qualcomm.com>
Signed-off-by: default avatarHans Verkuil <hverkuil+cisco@kernel.org>
parent b7571015
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -381,8 +381,6 @@ struct ov02c10 {
	struct v4l2_ctrl *vblank;
	struct v4l2_ctrl *hblank;
	struct v4l2_ctrl *exposure;
	struct v4l2_ctrl *hflip;
	struct v4l2_ctrl *vflip;

	struct clk *img_clk;
	struct gpio_desc *reset;
@@ -471,7 +469,7 @@ static int ov02c10_set_ctrl(struct v4l2_ctrl *ctrl)
		cci_write(ov02c10->regmap, OV02C10_ISP_Y_WIN_CONTROL,
			  ctrl->val ? 2 : 1, &ret);
		cci_update_bits(ov02c10->regmap, OV02C10_ROTATE_CONTROL,
				BIT(4), ov02c10->vflip->val << 4, &ret);
				BIT(4), ctrl->val << 4, &ret);
		break;

	default:
@@ -549,11 +547,11 @@ static int ov02c10_init_controls(struct ov02c10 *ov02c10)
					      OV02C10_EXPOSURE_STEP,
					      exposure_max);

	ov02c10->hflip = v4l2_ctrl_new_std(ctrl_hdlr, &ov02c10_ctrl_ops,
					   V4L2_CID_HFLIP, 0, 1, 1, 0);
	v4l2_ctrl_new_std(ctrl_hdlr, &ov02c10_ctrl_ops, V4L2_CID_HFLIP,
			  0, 1, 1, 0);

	ov02c10->vflip = v4l2_ctrl_new_std(ctrl_hdlr, &ov02c10_ctrl_ops,
					   V4L2_CID_VFLIP, 0, 1, 1, 0);
	v4l2_ctrl_new_std(ctrl_hdlr, &ov02c10_ctrl_ops, V4L2_CID_VFLIP,
			  0, 1, 1, 0);

	v4l2_ctrl_new_std_menu_items(ctrl_hdlr, &ov02c10_ctrl_ops,
				     V4L2_CID_TEST_PATTERN,