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

media: i2c: ov13b10: Drop stream handling in runtime PM handlers

The sensor is guaranteed not to be streaming when the runtime PM resume
handler is called, as the resume handler is only called from the
.s_stream() operation when starting streaming. Similarly, the sensor has
been stopped when the runtime PM suspend handler is called. There is
thus no need for manual stream start/stop from the runtime PM handlers.
Drop them.

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
5c873f07 55e941d0

+1 -33
+1 -33
drivers/media/i2c/ov13b10.c
··· 650 650 /* Mutex for serialized access */ 651 651 struct mutex mutex; 652 652 653 - /* Streaming on/off */ 654 - bool streaming; 655 - 656 653 /* True if the device has been identified */ 657 654 bool identified; 658 655 }; ··· 1232 1235 pm_runtime_put(&client->dev); 1233 1236 } 1234 1237 1235 - ov13b->streaming = enable; 1236 1238 mutex_unlock(&ov13b->mutex); 1237 1239 1238 1240 return ret; ··· 1246 1250 1247 1251 static int ov13b10_suspend(struct device *dev) 1248 1252 { 1249 - struct v4l2_subdev *sd = dev_get_drvdata(dev); 1250 - struct ov13b10 *ov13b = to_ov13b10(sd); 1251 - 1252 - if (ov13b->streaming) 1253 - ov13b10_stop_streaming(ov13b); 1254 - 1255 1253 ov13b10_power_off(dev); 1256 1254 1257 1255 return 0; ··· 1253 1263 1254 1264 static int ov13b10_resume(struct device *dev) 1255 1265 { 1256 - struct v4l2_subdev *sd = dev_get_drvdata(dev); 1257 - struct ov13b10 *ov13b = to_ov13b10(sd); 1258 - int ret; 1259 - 1260 - ret = ov13b10_power_on(dev); 1261 - if (ret) 1262 - goto pm_fail; 1263 - 1264 - if (ov13b->streaming) { 1265 - ret = ov13b10_start_streaming(ov13b); 1266 - if (ret) 1267 - goto stop_streaming; 1268 - } 1269 - 1270 - return 0; 1271 - 1272 - stop_streaming: 1273 - ov13b10_stop_streaming(ov13b); 1274 - ov13b10_power_off(dev); 1275 - pm_fail: 1276 - ov13b->streaming = false; 1277 - 1278 - return ret; 1266 + return ov13b10_power_on(dev); 1279 1267 } 1280 1268 1281 1269 static const struct v4l2_subdev_video_ops ov13b10_video_ops = {