Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: i2c: ov4689: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Mikhail Rudenko <mike.rudenko@gmail.com>
[Sakari Ailus: remove now-redundant "streaming" from comment.]
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

authored by

Laurent Pinchart and committed by
Hans Verkuil
e8d6eb9a 58e7ab2f

+1 -8
+1 -8
drivers/media/i2c/ov4689.c
··· 99 99 100 100 u32 clock_rate; 101 101 102 - struct mutex mutex; /* lock to protect streaming, ctrls and cur_mode */ 103 - bool streaming; 102 + struct mutex mutex; /* lock to protect ctrls and cur_mode */ 104 103 struct v4l2_ctrl_handler ctrl_handler; 105 104 struct v4l2_ctrl *exposure; 106 105 ··· 467 468 468 469 mutex_lock(&ov4689->mutex); 469 470 470 - on = !!on; 471 - if (on == ov4689->streaming) 472 - goto unlock_and_return; 473 - 474 471 if (on) { 475 472 ret = pm_runtime_resume_and_get(&client->dev); 476 473 if (ret < 0) ··· 498 503 OV4689_MODE_SW_STANDBY); 499 504 pm_runtime_put(&client->dev); 500 505 } 501 - 502 - ov4689->streaming = on; 503 506 504 507 unlock_and_return: 505 508 mutex_unlock(&ov4689->mutex);