summaryrefslogtreecommitdiff
path: root/drivers/media/i2c/ov9734.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/i2c/ov9734.c')
-rw-r--r--drivers/media/i2c/ov9734.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/media/i2c/ov9734.c b/drivers/media/i2c/ov9734.c
index 4b9a2e9288e7..e212465489e8 100644
--- a/drivers/media/i2c/ov9734.c
+++ b/drivers/media/i2c/ov9734.c
@@ -637,10 +637,12 @@ static int ov9734_set_stream(struct v4l2_subdev *sd, int enable)
struct i2c_client *client = v4l2_get_subdevdata(sd);
int ret = 0;
- if (ov9734->streaming == enable)
+ mutex_lock(&ov9734->mutex);
+ if (ov9734->streaming == enable) {
+ mutex_unlock(&ov9734->mutex);
return 0;
+ }
- mutex_lock(&ov9734->mutex);
if (enable) {
ret = pm_runtime_get_sync(&client->dev);
if (ret < 0) {