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

media: i2c: imx334: 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>
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
5a6e2fc7 1cbdd665

-9
-9
drivers/media/i2c/imx334.c
··· 138 138 * @mutex: Mutex for serializing sensor controls 139 139 * @menu_skip_mask: Menu skip mask for link_freq_ctrl 140 140 * @cur_code: current selected format code 141 - * @streaming: Flag indicating streaming state 142 141 */ 143 142 struct imx334 { 144 143 struct device *dev; ··· 160 161 struct mutex mutex; 161 162 unsigned long menu_skip_mask; 162 163 u32 cur_code; 163 - bool streaming; 164 164 }; 165 165 166 166 static const s64 link_freq[] = { ··· 1049 1051 1050 1052 mutex_lock(&imx334->mutex); 1051 1053 1052 - if (imx334->streaming == enable) { 1053 - mutex_unlock(&imx334->mutex); 1054 - return 0; 1055 - } 1056 - 1057 1054 if (enable) { 1058 1055 ret = pm_runtime_resume_and_get(imx334->dev); 1059 1056 if (ret < 0) ··· 1061 1068 imx334_stop_streaming(imx334); 1062 1069 pm_runtime_put(imx334->dev); 1063 1070 } 1064 - 1065 - imx334->streaming = enable; 1066 1071 1067 1072 mutex_unlock(&imx334->mutex); 1068 1073