On Mon Dec 8 15:37:24 2025 +0100, Hans de Goede wrote:
> 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]>

Patch committed.

Thanks,
Hans Verkuil

 drivers/media/i2c/ov02c10.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

---

diff --git a/drivers/media/i2c/ov02c10.c b/drivers/media/i2c/ov02c10.c
index f912ae142040..cf93d36032e1 100644
--- a/drivers/media/i2c/ov02c10.c
+++ b/drivers/media/i2c/ov02c10.c
@@ -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,
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to