diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2009-03-03 23:21:03 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:43:06 -0400 |
commit | f3334bcbf44ad9001460508ef4fbe51e706d24cf (patch) | |
tree | 2bd63d698c882e870eb6bf7e008e0377ea443a14 | |
parent | 522a5f1430bb85ca00928b99caf3892023ad9632 (diff) |
V4L/DVB (10816): cx88: Don't need to zero ioctl parameter fields
The v4l2 core code in v4l2_ioctl will zero out the structure the driver is
supposed to fill in for read-only ioctls. For read/write ioctls, all the
fields which aren't supplied from userspace will be zeroed out.
Zeroing code is removed from enum_input and g_tuner.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/cx88/cx88-video.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 5ed1c5a52cdd..2092e439ef00 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c | |||
@@ -1277,15 +1277,12 @@ int cx88_enum_input (struct cx88_core *core,struct v4l2_input *i) | |||
1277 | [ CX88_VMUX_DVB ] = "DVB", | 1277 | [ CX88_VMUX_DVB ] = "DVB", |
1278 | [ CX88_VMUX_DEBUG ] = "for debug only", | 1278 | [ CX88_VMUX_DEBUG ] = "for debug only", |
1279 | }; | 1279 | }; |
1280 | unsigned int n; | 1280 | unsigned int n = i->index; |
1281 | 1281 | ||
1282 | n = i->index; | ||
1283 | if (n >= 4) | 1282 | if (n >= 4) |
1284 | return -EINVAL; | 1283 | return -EINVAL; |
1285 | if (0 == INPUT(n).type) | 1284 | if (0 == INPUT(n).type) |
1286 | return -EINVAL; | 1285 | return -EINVAL; |
1287 | memset(i,0,sizeof(*i)); | ||
1288 | i->index = n; | ||
1289 | i->type = V4L2_INPUT_TYPE_CAMERA; | 1286 | i->type = V4L2_INPUT_TYPE_CAMERA; |
1290 | strcpy(i->name,iname[INPUT(n).type]); | 1287 | strcpy(i->name,iname[INPUT(n).type]); |
1291 | if ((CX88_VMUX_TELEVISION == INPUT(n).type) || | 1288 | if ((CX88_VMUX_TELEVISION == INPUT(n).type) || |
@@ -1521,7 +1518,6 @@ static int radio_g_audio (struct file *file, void *priv, struct v4l2_audio *a) | |||
1521 | if (unlikely(a->index)) | 1518 | if (unlikely(a->index)) |
1522 | return -EINVAL; | 1519 | return -EINVAL; |
1523 | 1520 | ||
1524 | memset(a,0,sizeof(*a)); | ||
1525 | strcpy(a->name,"Radio"); | 1521 | strcpy(a->name,"Radio"); |
1526 | return 0; | 1522 | return 0; |
1527 | } | 1523 | } |