Skip to content

Commit 69d6c6f

Browse files
Hans de GoedeHans Verkuil
authored andcommitted
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: Bryan O'Donoghue <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]> Tested-by: Sebastian Reichel <[email protected]> # T14s Gen6 Snapdragon Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
1 parent b757101 commit 69d6c6f

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

drivers/media/i2c/ov02c10.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,6 @@ struct ov02c10 {
381381
struct v4l2_ctrl *vblank;
382382
struct v4l2_ctrl *hblank;
383383
struct v4l2_ctrl *exposure;
384-
struct v4l2_ctrl *hflip;
385-
struct v4l2_ctrl *vflip;
386384

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

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

552-
ov02c10->hflip = v4l2_ctrl_new_std(ctrl_hdlr, &ov02c10_ctrl_ops,
553-
V4L2_CID_HFLIP, 0, 1, 1, 0);
550+
v4l2_ctrl_new_std(ctrl_hdlr, &ov02c10_ctrl_ops, V4L2_CID_HFLIP,
551+
0, 1, 1, 0);
554552

555-
ov02c10->vflip = v4l2_ctrl_new_std(ctrl_hdlr, &ov02c10_ctrl_ops,
556-
V4L2_CID_VFLIP, 0, 1, 1, 0);
553+
v4l2_ctrl_new_std(ctrl_hdlr, &ov02c10_ctrl_ops, V4L2_CID_VFLIP,
554+
0, 1, 1, 0);
557555

558556
v4l2_ctrl_new_std_menu_items(ctrl_hdlr, &ov02c10_ctrl_ops,
559557
V4L2_CID_TEST_PATTERN,

0 commit comments

Comments
 (0)