summaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/ivtv/ivtv-fileops.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2012-10-01 06:23:53 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-10-01 17:14:27 -0300
commit7eaf49667e23a11a1f6ec88dad51ad0e93b1445d (patch)
tree5991c6f693139ba344b54c0b6869134c8bab57e9 /drivers/media/pci/ivtv/ivtv-fileops.c
parentf659f0e7a66245295e1930ad21dfabf80c1403bf (diff)
downloadop-kernel-dev-7eaf49667e23a11a1f6ec88dad51ad0e93b1445d.zip
op-kernel-dev-7eaf49667e23a11a1f6ec88dad51ad0e93b1445d.tar.gz
[media] ivtv: fix v4l2-compliance errors for the radio device
- fix error code when attempting to read from write-only streams. - fix error code when attempting to write to read-only streams. - don't start capturing when polling on a radio node. - give the radio node its own file operations struct. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/pci/ivtv/ivtv-fileops.c')
-rw-r--r--drivers/media/pci/ivtv/ivtv-fileops.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/pci/ivtv/ivtv-fileops.c b/drivers/media/pci/ivtv/ivtv-fileops.c
index 7f2eb5f..9caffd8 100644
--- a/drivers/media/pci/ivtv/ivtv-fileops.c
+++ b/drivers/media/pci/ivtv/ivtv-fileops.c
@@ -435,7 +435,7 @@ int ivtv_start_capture(struct ivtv_open_id *id)
s->type == IVTV_DEC_STREAM_TYPE_YUV ||
s->type == IVTV_DEC_STREAM_TYPE_VOUT) {
/* you cannot read from these stream types. */
- return -EPERM;
+ return -EINVAL;
}
/* Try to claim this stream. */
@@ -564,7 +564,7 @@ static ssize_t ivtv_write(struct file *filp, const char __user *user_buf, size_t
s->type != IVTV_DEC_STREAM_TYPE_YUV &&
s->type != IVTV_DEC_STREAM_TYPE_VOUT)
/* not decoder streams */
- return -EPERM;
+ return -EINVAL;
/* Try to claim this stream */
if (ivtv_claim_stream(id, s->type))
@@ -775,6 +775,7 @@ unsigned int ivtv_v4l2_enc_poll(struct file *filp, poll_table *wait)
/* Start a capture if there is none */
if (!eof && !test_bit(IVTV_F_S_STREAMING, &s->s_flags) &&
+ s->type != IVTV_ENC_STREAM_TYPE_RAD &&
(req_events & (POLLIN | POLLRDNORM))) {
int rc;
OpenPOWER on IntegriCloud