]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: ov02c10: Remove unnecessary hflip and vflip pointers
authorHans de Goede <johannes.goede@oss.qualcomm.com>
Mon, 8 Dec 2025 14:37:24 +0000 (15:37 +0100)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Tue, 6 Jan 2026 08:33:33 +0000 (09:33 +0100)
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 <bod@kernel.org>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Tested-by: Sebastian Reichel <sre@kernel.org> # T14s Gen6 Snapdragon
Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/i2c/ov02c10.c

index f912ae1420408fef61d4205bc12a7d7184c9f629..cf93d36032e14712209d50f4a8e223541c666e79 100644 (file)
@@ -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,