diff options
author | Chaithrika U S <chaithrika@ti.com> | 2009-06-22 08:02:55 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-09-18 23:18:06 -0400 |
commit | 13df4f6a36e41e0c8f25273ef2077b239f633265 (patch) | |
tree | 8b88bd4df5f23a1ef25a902783c2fc1665fce25d /drivers/media | |
parent | e9f4bb559c39cd85ef5365fa50e1893df4b67b96 (diff) |
V4L/DVB (12178): vpif_display: Fix compile time warnings for mutex locking
mutex_lock_interruptible return value has to be handled properly to indicate
the status to the higher layers of the kernel.
Signed-off-by: Chaithrika U S <chaithrika@ti.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/davinci/vpif_display.c | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c index 5e2b86b3fa61..969d4b3aa785 100644 --- a/drivers/media/video/davinci/vpif_display.c +++ b/drivers/media/video/davinci/vpif_display.c | |||
@@ -636,7 +636,9 @@ static int vpif_release(struct file *filep) | |||
636 | struct channel_obj *ch = fh->channel; | 636 | struct channel_obj *ch = fh->channel; |
637 | struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; | 637 | struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; |
638 | 638 | ||
639 | mutex_lock_interruptible(&common->lock); | 639 | if (mutex_lock_interruptible(&common->lock)) |
640 | return -ERESTARTSYS; | ||
641 | |||
640 | /* if this instance is doing IO */ | 642 | /* if this instance is doing IO */ |
641 | if (fh->io_allowed[VPIF_VIDEO_INDEX]) { | 643 | if (fh->io_allowed[VPIF_VIDEO_INDEX]) { |
642 | /* Reset io_usrs member of channel object */ | 644 | /* Reset io_usrs member of channel object */ |
@@ -720,7 +722,9 @@ static int vpif_g_fmt_vid_out(struct file *file, void *priv, | |||
720 | return -EINVAL; | 722 | return -EINVAL; |
721 | 723 | ||
722 | /* Fill in the information about format */ | 724 | /* Fill in the information about format */ |
723 | mutex_lock_interruptible(&common->lock); | 725 | if (mutex_lock_interruptible(&common->lock)) |
726 | return -ERESTARTSYS; | ||
727 | |||
724 | if (vpif_get_std_info(ch)) { | 728 | if (vpif_get_std_info(ch)) { |
725 | vpif_err("Error getting the standard info\n"); | 729 | vpif_err("Error getting the standard info\n"); |
726 | return -EINVAL; | 730 | return -EINVAL; |
@@ -768,7 +772,9 @@ static int vpif_s_fmt_vid_out(struct file *file, void *priv, | |||
768 | /* store the pix format in the channel object */ | 772 | /* store the pix format in the channel object */ |
769 | common->fmt.fmt.pix = *pixfmt; | 773 | common->fmt.fmt.pix = *pixfmt; |
770 | /* store the format in the channel object */ | 774 | /* store the format in the channel object */ |
771 | mutex_lock_interruptible(&common->lock); | 775 | if (mutex_lock_interruptible(&common->lock)) |
776 | return -ERESTARTSYS; | ||
777 | |||
772 | common->fmt = *fmt; | 778 | common->fmt = *fmt; |
773 | mutex_unlock(&common->lock); | 779 | mutex_unlock(&common->lock); |
774 | 780 | ||
@@ -819,7 +825,9 @@ static int vpif_reqbufs(struct file *file, void *priv, | |||
819 | index = VPIF_VIDEO_INDEX; | 825 | index = VPIF_VIDEO_INDEX; |
820 | 826 | ||
821 | common = &ch->common[index]; | 827 | common = &ch->common[index]; |
822 | mutex_lock_interruptible(&common->lock); | 828 | if (mutex_lock_interruptible(&common->lock)) |
829 | return -ERESTARTSYS; | ||
830 | |||
823 | if (common->fmt.type != reqbuf->type) { | 831 | if (common->fmt.type != reqbuf->type) { |
824 | ret = -EINVAL; | 832 | ret = -EINVAL; |
825 | goto reqbuf_exit; | 833 | goto reqbuf_exit; |
@@ -979,7 +987,8 @@ static int vpif_s_std(struct file *file, void *priv, v4l2_std_id *std_id) | |||
979 | } | 987 | } |
980 | 988 | ||
981 | /* Call encoder subdevice function to set the standard */ | 989 | /* Call encoder subdevice function to set the standard */ |
982 | mutex_lock_interruptible(&common->lock); | 990 | if (mutex_lock_interruptible(&common->lock)) |
991 | return -ERESTARTSYS; | ||
983 | 992 | ||
984 | ch->video.stdid = *std_id; | 993 | ch->video.stdid = *std_id; |
985 | /* Get the information about the standard */ | 994 | /* Get the information about the standard */ |
@@ -1085,7 +1094,9 @@ static int vpif_streamon(struct file *file, void *priv, | |||
1085 | return ret; | 1094 | return ret; |
1086 | } | 1095 | } |
1087 | 1096 | ||
1088 | mutex_lock_interruptible(&common->lock); | 1097 | if (mutex_lock_interruptible(&common->lock)) |
1098 | return -ERESTARTSYS; | ||
1099 | |||
1089 | /* If buffer queue is empty, return error */ | 1100 | /* If buffer queue is empty, return error */ |
1090 | if (list_empty(&common->dma_queue)) { | 1101 | if (list_empty(&common->dma_queue)) { |
1091 | vpif_err("buffer queue is empty\n"); | 1102 | vpif_err("buffer queue is empty\n"); |
@@ -1185,7 +1196,9 @@ static int vpif_streamoff(struct file *file, void *priv, | |||
1185 | return -EINVAL; | 1196 | return -EINVAL; |
1186 | } | 1197 | } |
1187 | 1198 | ||
1188 | mutex_lock_interruptible(&common->lock); | 1199 | if (mutex_lock_interruptible(&common->lock)) |
1200 | return -ERESTARTSYS; | ||
1201 | |||
1189 | if (buftype == V4L2_BUF_TYPE_VIDEO_OUTPUT) { | 1202 | if (buftype == V4L2_BUF_TYPE_VIDEO_OUTPUT) { |
1190 | /* disable channel */ | 1203 | /* disable channel */ |
1191 | if (VPIF_CHANNEL2_VIDEO == ch->channel_id) { | 1204 | if (VPIF_CHANNEL2_VIDEO == ch->channel_id) { |
@@ -1248,7 +1261,9 @@ static int vpif_s_output(struct file *file, void *priv, unsigned int i) | |||
1248 | struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; | 1261 | struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; |
1249 | int ret = 0; | 1262 | int ret = 0; |
1250 | 1263 | ||
1251 | mutex_lock_interruptible(&common->lock); | 1264 | if (mutex_lock_interruptible(&common->lock)) |
1265 | return -ERESTARTSYS; | ||
1266 | |||
1252 | if (common->started) { | 1267 | if (common->started) { |
1253 | vpif_err("Streaming in progress\n"); | 1268 | vpif_err("Streaming in progress\n"); |
1254 | ret = -EBUSY; | 1269 | ret = -EBUSY; |