summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>2024-10-18 16:32:25 +0100
committerHans Verkuil <hverkuil@xs4all.nl>2024-11-07 09:05:59 +0100
commitecf85e03b4ab5a387895f71cf13a231277af9fa0 (patch)
treeaada74df9f0abcb60fd5711bb6802985a91c68a8 /drivers/media
parent885ac98717242596a315886fce5087be6598c23c (diff)
media: i2c: ov5645: Drop `power_lock` mutex
Remove the `power_lock` mutex used during control applications, as it is only utilized in the .s_ctrl() function. Since the control framework already serializes calls to this function, the mutex is unnecessary. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/i2c/ov5645.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c
index a877fffbd218..b89b69767209 100644
--- a/drivers/media/i2c/ov5645.c
+++ b/drivers/media/i2c/ov5645.c
@@ -105,8 +105,6 @@ struct ov5645 {
u8 timing_tc_reg20;
u8 timing_tc_reg21;
- struct mutex power_lock; /* lock to protect power state */
-
struct gpio_desc *enable_gpio;
struct gpio_desc *rst_gpio;
};
@@ -781,11 +779,8 @@ static int ov5645_s_ctrl(struct v4l2_ctrl *ctrl)
struct ov5645, ctrls);
int ret;
- mutex_lock(&ov5645->power_lock);
- if (!pm_runtime_get_if_in_use(ov5645->dev)) {
- mutex_unlock(&ov5645->power_lock);
+ if (!pm_runtime_get_if_in_use(ov5645->dev))
return 0;
- }
switch (ctrl->id) {
case V4L2_CID_SATURATION:
@@ -816,7 +811,6 @@ static int ov5645_s_ctrl(struct v4l2_ctrl *ctrl)
pm_runtime_mark_last_busy(ov5645->dev);
pm_runtime_put_autosuspend(ov5645->dev);
- mutex_unlock(&ov5645->power_lock);
return ret;
}
@@ -1126,8 +1120,6 @@ static int ov5645_probe(struct i2c_client *client)
return dev_err_probe(dev, PTR_ERR(ov5645->rst_gpio),
"cannot get reset gpio\n");
- mutex_init(&ov5645->power_lock);
-
v4l2_ctrl_handler_init(&ov5645->ctrls, 9);
v4l2_ctrl_new_std(&ov5645->ctrls, &ov5645_ctrl_ops,
V4L2_CID_SATURATION, -4, 4, 1, 0);
@@ -1250,7 +1242,6 @@ free_entity:
media_entity_cleanup(&ov5645->sd.entity);
free_ctrl:
v4l2_ctrl_handler_free(&ov5645->ctrls);
- mutex_destroy(&ov5645->power_lock);
return ret;
}
@@ -1267,7 +1258,6 @@ static void ov5645_remove(struct i2c_client *client)
if (!pm_runtime_status_suspended(ov5645->dev))
ov5645_set_power_off(ov5645->dev);
pm_runtime_set_suspended(ov5645->dev);
- mutex_destroy(&ov5645->power_lock);
}
static const struct i2c_device_id ov5645_id[] = {