Skip to contentSkip to conversation

media: i2c: ov5647: use our own mutex for the ctrl lock

PATCH New Xiaolei Wang 1 participant 4 messages Mar 1

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: i2c: ov5647: use our own mutex for the ctrl lock

[ Upstream commit 973e42fd5d2b397bff34f0c249014902dbf65912 ]

__v4l2_ctrl_handler_setup() and __v4l2_ctrl_modify_range() contains an assertion to verify that the v4l2_ctrl_handler::lock is held, as it should only be called when the lock has already been acquired. Therefore use our own mutex for the ctrl lock, otherwise a warning will be reported.

Fixes 4974c2f19fd8 ("media: ov5647: Support gain, exposure and AWB controls")
[Sakari Ailus: Fix a minor conflict.]
---
 drivers/media/i2c/ov5647.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/media/i2c/ov5647.c +2 -0
index a727beb9d57e..548fde4276fc 100644
@@ -1291,6 +1291,8 @@ static int ov5647_init_controls(struct ov5647 *sensor)
 
 	v4l2_ctrl_handler_init(&sensor->ctrls, 9);
 
+	sensor->ctrls.lock = &sensor->lock;
+
 	v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops,
 			  V4L2_CID_AUTOGAIN, 0, 1, 1, 0);
 
Signature · 1 line
2.49.0
#1 lore raw

PATCH 1/1 media: i2c: ov5647: use our own mutex for the ctrl lock

[ Upstream commit 973e42fd5d2b397bff34f0c249014902dbf65912 ]

__v4l2_ctrl_handler_setup() and __v4l2_ctrl_modify_range() contains an assertion to verify that the v4l2_ctrl_handler::lock is held, as it should only be called when the lock has already been acquired. Therefore use our own mutex for the ctrl lock, otherwise a warning will be reported.

Fixes 4974c2f19fd8 ("media: ov5647: Support gain, exposure and AWB controls")
[Sakari Ailus: Fix a minor conflict.]
---
 drivers/media/i2c/ov5647.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/media/i2c/ov5647.c +2 -0
index 847a7bbb69c5..cf8a84fa3100 100644
@@ -1272,6 +1272,8 @@ static int ov5647_init_controls(struct ov5647 *sensor)
 
 	v4l2_ctrl_handler_init(&sensor->ctrls, 8);
 
+	sensor->ctrls.lock = &sensor->lock;
+
 	v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops,
 			  V4L2_CID_AUTOGAIN, 0, 1, 1, 0);
 
Signature · 1 line
2.49.0
#2 lore raw

PATCH 1/1 media: i2c: ov5647: use our own mutex for the ctrl lock

In reply to Xiaolei Wang

[ Upstream commit 973e42fd5d2b397bff34f0c249014902dbf65912 ]

__v4l2_ctrl_handler_setup() and __v4l2_ctrl_modify_range() contains an assertion to verify that the v4l2_ctrl_handler::lock is held, as it should only be called when the lock has already been acquired. Therefore use our own mutex for the ctrl lock, otherwise a warning will be reported.

Fixes 4974c2f19fd8 ("media: ov5647: Support gain, exposure and AWB controls")
[Sakari Ailus: Fix a minor conflict.]
---
 drivers/media/i2c/ov5647.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/media/i2c/ov5647.c +2 -0
index a727beb9d57e..548fde4276fc 100644
@@ -1291,6 +1291,8 @@ static int ov5647_init_controls(struct ov5647 *sensor)
 
 	v4l2_ctrl_handler_init(&sensor->ctrls, 9);
 
+	sensor->ctrls.lock = &sensor->lock;
+
 	v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops,
 			  V4L2_CID_AUTOGAIN, 0, 1, 1, 0);
 
Signature · 1 line
2.49.0
#3 lore raw

PATCH 1/1 media: i2c: ov5647: use our own mutex for the ctrl lock

In reply to Xiaolei Wang

[ Upstream commit 973e42fd5d2b397bff34f0c249014902dbf65912 ]

__v4l2_ctrl_handler_setup() and __v4l2_ctrl_modify_range() contains an assertion to verify that the v4l2_ctrl_handler::lock is held, as it should only be called when the lock has already been acquired. Therefore use our own mutex for the ctrl lock, otherwise a warning will be reported.

Fixes 4974c2f19fd8 ("media: ov5647: Support gain, exposure and AWB controls")
[Sakari Ailus: Fix a minor conflict.]
---
 drivers/media/i2c/ov5647.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/media/i2c/ov5647.c +2 -0
index 847a7bbb69c5..cf8a84fa3100 100644
@@ -1272,6 +1272,8 @@ static int ov5647_init_controls(struct ov5647 *sensor)
 
 	v4l2_ctrl_handler_init(&sensor->ctrls, 8);
 
+	sensor->ctrls.lock = &sensor->lock;
+
 	v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops,
 			  V4L2_CID_AUTOGAIN, 0, 1, 1, 0);
 
Signature · 1 line
2.49.0