The patch number 12161 was added via Mauro Carvalho Chehab <mche...@redhat.com> to http://linuxtv.org/hg/v4l-dvb master development tree.
Kernel patches in this development tree may be modified to be backward compatible with older kernels. Compatibility modifications will be removed before inclusion into the mainstream Kernel If anyone has any objections, please let us know by sending a message to: Linux Media Mailing List <linux-me...@vger.kernel.org> ------ From: Mauro Carvalho Chehab <mche...@redhat.com> merge: http://linuxtv.org/hg/~gliakhovetski/v4l-dvb Signed-off-by: Mauro Carvalho Chehab <mche...@redhat.com> --- linux/drivers/media/video/soc_camera.c | 18 +++++++++++------- linux/include/media/v4l2-subdev.h | 3 +++ 2 files changed, 14 insertions(+), 7 deletions(-) diff -r fa37f31b0c06 -r d443ccd3d58f linux/drivers/media/video/soc_camera.c --- a/linux/drivers/media/video/soc_camera.c Tue Jun 30 16:36:08 2009 -0300 +++ b/linux/drivers/media/video/soc_camera.c Tue Jun 30 16:37:54 2009 -0300 @@ -238,11 +238,11 @@ static int soc_camera_init_user_formats( return -ENOMEM; icd->num_user_formats = fmts; + + dev_dbg(&icd->dev, "Found %d supported formats.\n", fmts); + + /* Second pass - actually fill data formats */ fmts = 0; - - dev_dbg(&icd->dev, "Found %d supported formats.\n", fmts); - - /* Second pass - actually fill data formats */ for (i = 0; i < icd->num_formats; i++) if (!ici->ops->get_formats) { icd->user_formats[i].host_fmt = icd->formats + i; @@ -878,8 +878,11 @@ static int soc_camera_probe(struct devic (unsigned short)~0; ret = soc_camera_init_user_formats(icd); - if (ret < 0) + if (ret < 0) { + if (icd->ops->remove) + icd->ops->remove(icd); goto eiufmt; + } icd->height = DEFAULT_HEIGHT; icd->width = DEFAULT_WIDTH; @@ -903,8 +906,10 @@ static int soc_camera_remove(struct devi { struct soc_camera_device *icd = to_soc_camera_dev(dev); + mutex_lock(&icd->video_lock); if (icd->ops->remove) icd->ops->remove(icd); + mutex_unlock(&icd->video_lock); soc_camera_free_user_formats(icd); @@ -1146,6 +1151,7 @@ evidallocd: } EXPORT_SYMBOL(soc_camera_video_start); +/* Called from client .remove() methods with .video_lock held */ void soc_camera_video_stop(struct soc_camera_device *icd) { struct video_device *vdev = icd->vdev; @@ -1155,10 +1161,8 @@ void soc_camera_video_stop(struct soc_ca if (!icd->dev.parent || !vdev) return; - mutex_lock(&icd->video_lock); video_unregister_device(vdev); icd->vdev = NULL; - mutex_unlock(&icd->video_lock); } EXPORT_SYMBOL(soc_camera_video_stop); diff -r fa37f31b0c06 -r d443ccd3d58f linux/include/media/v4l2-subdev.h --- a/linux/include/media/v4l2-subdev.h Tue Jun 30 16:36:08 2009 -0300 +++ b/linux/include/media/v4l2-subdev.h Tue Jun 30 16:37:54 2009 -0300 @@ -220,6 +220,9 @@ struct v4l2_subdev_video_ops { int (*g_fmt)(struct v4l2_subdev *sd, struct v4l2_format *fmt); int (*try_fmt)(struct v4l2_subdev *sd, struct v4l2_format *fmt); int (*s_fmt)(struct v4l2_subdev *sd, struct v4l2_format *fmt); + int (*cropcap)(struct v4l2_subdev *sd, struct v4l2_cropcap *cc); + int (*g_crop)(struct v4l2_subdev *sd, struct v4l2_crop *crop); + int (*s_crop)(struct v4l2_subdev *sd, struct v4l2_crop *crop); int (*g_parm)(struct v4l2_subdev *sd, struct v4l2_streamparm *param); int (*s_parm)(struct v4l2_subdev *sd, struct v4l2_streamparm *param); int (*enum_framesizes)(struct v4l2_subdev *sd, struct v4l2_frmsizeenum *fsize); --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/d443ccd3d58f300e42ab0ffb9b3fff591c84ed1e _______________________________________________ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits