aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2016-04-15 07:58:10 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-04-20 15:00:59 -0400
commit8bbb6568428fa14c5bef120d443c20e0e7d52699 (patch)
treeccac0325339e559b250fe8c478f2d107e54ab1ad
parentd5468d7afaa9c9e961e150f0455a14a9f4872a98 (diff)
[media] davinci_vpfe: Revert "staging: media: davinci_vpfe: remove,unnecessary ret variable"
This reverts commit afa5d19a2b5f ("staging: media: davinci_vpfe: remove unnecessary ret variable"). This patch is completely bogus and messed up the code big time. I'm not sure what was intended, but this isn't it. Cc: Thaissa Falbo <thaissa.falbo@gmail.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r--drivers/staging/media/davinci_vpfe/vpfe_video.c54
1 files changed, 34 insertions, 20 deletions
diff --git a/drivers/staging/media/davinci_vpfe/vpfe_video.c b/drivers/staging/media/davinci_vpfe/vpfe_video.c
index b793c04028a3..be72a8e5f221 100644
--- a/drivers/staging/media/davinci_vpfe/vpfe_video.c
+++ b/drivers/staging/media/davinci_vpfe/vpfe_video.c
@@ -172,9 +172,11 @@ static int vpfe_prepare_pipeline(struct vpfe_video_device *video)
172static int vpfe_update_pipe_state(struct vpfe_video_device *video) 172static int vpfe_update_pipe_state(struct vpfe_video_device *video)
173{ 173{
174 struct vpfe_pipeline *pipe = &video->pipe; 174 struct vpfe_pipeline *pipe = &video->pipe;
175 int ret;
175 176
176 if (vpfe_prepare_pipeline(video)) 177 ret = vpfe_prepare_pipeline(video);
177 return vpfe_prepare_pipeline(video); 178 if (ret)
179 return ret;
178 180
179 /* 181 /*
180 * Find out if there is any input video 182 * Find out if there is any input video
@@ -182,9 +184,10 @@ static int vpfe_update_pipe_state(struct vpfe_video_device *video)
182 */ 184 */
183 if (pipe->input_num == 0) { 185 if (pipe->input_num == 0) {
184 pipe->state = VPFE_PIPELINE_STREAM_CONTINUOUS; 186 pipe->state = VPFE_PIPELINE_STREAM_CONTINUOUS;
185 if (vpfe_update_current_ext_subdev(video)) { 187 ret = vpfe_update_current_ext_subdev(video);
188 if (ret) {
186 pr_err("Invalid external subdev\n"); 189 pr_err("Invalid external subdev\n");
187 return vpfe_update_current_ext_subdev(video); 190 return ret;
188 } 191 }
189 } else { 192 } else {
190 pipe->state = VPFE_PIPELINE_STREAM_SINGLESHOT; 193 pipe->state = VPFE_PIPELINE_STREAM_SINGLESHOT;
@@ -667,6 +670,7 @@ static int vpfe_enum_fmt(struct file *file, void *priv,
667 struct v4l2_subdev *subdev; 670 struct v4l2_subdev *subdev;
668 struct v4l2_format format; 671 struct v4l2_format format;
669 struct media_pad *remote; 672 struct media_pad *remote;
673 int ret;
670 674
671 v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_enum_fmt\n"); 675 v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_enum_fmt\n");
672 676
@@ -695,10 +699,11 @@ static int vpfe_enum_fmt(struct file *file, void *priv,
695 sd_fmt.pad = remote->index; 699 sd_fmt.pad = remote->index;
696 sd_fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE; 700 sd_fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE;
697 /* get output format of remote subdev */ 701 /* get output format of remote subdev */
698 if (v4l2_subdev_call(subdev, pad, get_fmt, NULL, &sd_fmt)) { 702 ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &sd_fmt);
703 if (ret) {
699 v4l2_err(&vpfe_dev->v4l2_dev, 704 v4l2_err(&vpfe_dev->v4l2_dev,
700 "invalid remote subdev for video node\n"); 705 "invalid remote subdev for video node\n");
701 return v4l2_subdev_call(subdev, pad, get_fmt, NULL, &sd_fmt); 706 return ret;
702 } 707 }
703 /* convert to pix format */ 708 /* convert to pix format */
704 mbus.code = sd_fmt.format.code; 709 mbus.code = sd_fmt.format.code;
@@ -725,6 +730,7 @@ static int vpfe_s_fmt(struct file *file, void *priv,
725 struct vpfe_video_device *video = video_drvdata(file); 730 struct vpfe_video_device *video = video_drvdata(file);
726 struct vpfe_device *vpfe_dev = video->vpfe_dev; 731 struct vpfe_device *vpfe_dev = video->vpfe_dev;
727 struct v4l2_format format; 732 struct v4l2_format format;
733 int ret;
728 734
729 v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_s_fmt\n"); 735 v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_s_fmt\n");
730 /* If streaming is started, return error */ 736 /* If streaming is started, return error */
@@ -733,8 +739,9 @@ static int vpfe_s_fmt(struct file *file, void *priv,
733 return -EBUSY; 739 return -EBUSY;
734 } 740 }
735 /* get adjacent subdev's output pad format */ 741 /* get adjacent subdev's output pad format */
736 if (__vpfe_video_get_format(video, &format)) 742 ret = __vpfe_video_get_format(video, &format);
737 return __vpfe_video_get_format(video, &format); 743 if (ret)
744 return ret;
738 *fmt = format; 745 *fmt = format;
739 video->fmt = *fmt; 746 video->fmt = *fmt;
740 return 0; 747 return 0;
@@ -757,11 +764,13 @@ static int vpfe_try_fmt(struct file *file, void *priv,
757 struct vpfe_video_device *video = video_drvdata(file); 764 struct vpfe_video_device *video = video_drvdata(file);
758 struct vpfe_device *vpfe_dev = video->vpfe_dev; 765 struct vpfe_device *vpfe_dev = video->vpfe_dev;
759 struct v4l2_format format; 766 struct v4l2_format format;
767 int ret;
760 768
761 v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_try_fmt\n"); 769 v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_try_fmt\n");
762 /* get adjacent subdev's output pad format */ 770 /* get adjacent subdev's output pad format */
763 if (__vpfe_video_get_format(video, &format)) 771 ret = __vpfe_video_get_format(video, &format);
764 return __vpfe_video_get_format(video, &format); 772 if (ret)
773 return ret;
765 774
766 *fmt = format; 775 *fmt = format;
767 return 0; 776 return 0;
@@ -838,8 +847,9 @@ static int vpfe_s_input(struct file *file, void *priv, unsigned int index)
838 847
839 v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_s_input\n"); 848 v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_s_input\n");
840 849
841 if (mutex_lock_interruptible(&video->lock)) 850 ret = mutex_lock_interruptible(&video->lock);
842 return mutex_lock_interruptible(&video->lock); 851 if (ret)
852 return ret;
843 /* 853 /*
844 * If streaming is started return device busy 854 * If streaming is started return device busy
845 * error 855 * error
@@ -940,8 +950,9 @@ static int vpfe_s_std(struct file *file, void *priv, v4l2_std_id std_id)
940 v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_s_std\n"); 950 v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_s_std\n");
941 951
942 /* Call decoder driver function to set the standard */ 952 /* Call decoder driver function to set the standard */
943 if (mutex_lock_interruptible(&video->lock)) 953 ret = mutex_lock_interruptible(&video->lock);
944 return mutex_lock_interruptible(&video->lock); 954 if (ret)
955 return ret;
945 sdinfo = video->current_ext_subdev; 956 sdinfo = video->current_ext_subdev;
946 /* If streaming is started, return device busy error */ 957 /* If streaming is started, return device busy error */
947 if (video->started) { 958 if (video->started) {
@@ -1327,8 +1338,9 @@ static int vpfe_reqbufs(struct file *file, void *priv,
1327 return -EINVAL; 1338 return -EINVAL;
1328 } 1339 }
1329 1340
1330 if (mutex_lock_interruptible(&video->lock)) 1341 ret = mutex_lock_interruptible(&video->lock);
1331 return mutex_lock_interruptible(&video->lock); 1342 if (ret)
1343 return ret;
1332 1344
1333 if (video->io_usrs != 0) { 1345 if (video->io_usrs != 0) {
1334 v4l2_err(&vpfe_dev->v4l2_dev, "Only one IO user allowed\n"); 1346 v4l2_err(&vpfe_dev->v4l2_dev, "Only one IO user allowed\n");
@@ -1354,10 +1366,11 @@ static int vpfe_reqbufs(struct file *file, void *priv,
1354 q->buf_struct_size = sizeof(struct vpfe_cap_buffer); 1366 q->buf_struct_size = sizeof(struct vpfe_cap_buffer);
1355 q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; 1367 q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
1356 1368
1357 if (vb2_queue_init(q)) { 1369 ret = vb2_queue_init(q);
1370 if (ret) {
1358 v4l2_err(&vpfe_dev->v4l2_dev, "vb2_queue_init() failed\n"); 1371 v4l2_err(&vpfe_dev->v4l2_dev, "vb2_queue_init() failed\n");
1359 vb2_dma_contig_cleanup_ctx(vpfe_dev->pdev); 1372 vb2_dma_contig_cleanup_ctx(vpfe_dev->pdev);
1360 return vb2_queue_init(q); 1373 return ret;
1361 } 1374 }
1362 1375
1363 fh->io_allowed = 1; 1376 fh->io_allowed = 1;
@@ -1533,8 +1546,9 @@ static int vpfe_streamoff(struct file *file, void *priv,
1533 return -EINVAL; 1546 return -EINVAL;
1534 } 1547 }
1535 1548
1536 if (mutex_lock_interruptible(&video->lock)) 1549 ret = mutex_lock_interruptible(&video->lock);
1537 return mutex_lock_interruptible(&video->lock); 1550 if (ret)
1551 return ret;
1538 1552
1539 vpfe_stop_capture(video); 1553 vpfe_stop_capture(video);
1540 ret = vb2_streamoff(&video->buffer_queue, buf_type); 1554 ret = vb2_streamoff(&video->buffer_queue, buf_type);