diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2010-12-29 12:29:55 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-12-30 05:02:29 -0500 |
commit | 657f2271050beabe725ba101c1d840f51a41f33d (patch) | |
tree | 740e898564868e8900ed3b61fc6d57b44e114b57 | |
parent | 3ea2b673a55cee528f83653e711d09425ed4d8b6 (diff) |
[media] v4l: fix handling of v4l2_input.capabilities
The v4l core sets the v4l2_input.capabilities field based on the supplied
v4l2_ioctl_ops. However, several drivers do a memset or memcpy of the v4l2_input
struct, thus overwriting that field incorrectly.
Either remove the memset (which is already done by the v4l core), or add the
proper capabilities field in case of a memcpy.
The same is also true for v4l2_output, but that only affected the ivtv driver.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/dvb/ttpci/av7110_v4l.c | 4 | ||||
-rw-r--r-- | drivers/media/dvb/ttpci/budget-av.c | 6 | ||||
-rw-r--r-- | drivers/media/video/cx18/cx18-cards.c | 1 | ||||
-rw-r--r-- | drivers/media/video/cx23885/cx23885-video.c | 1 | ||||
-rw-r--r-- | drivers/media/video/et61x251/et61x251_core.c | 1 | ||||
-rw-r--r-- | drivers/media/video/hexium_gemini.c | 18 | ||||
-rw-r--r-- | drivers/media/video/hexium_orion.c | 18 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-cards.c | 2 | ||||
-rw-r--r-- | drivers/media/video/mxb.c | 8 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-video.c | 1 | ||||
-rw-r--r-- | drivers/media/video/sn9c102/sn9c102_core.c | 1 | ||||
-rw-r--r-- | drivers/media/video/timblogiw.c | 1 | ||||
-rw-r--r-- | drivers/media/video/vino.c | 3 | ||||
-rw-r--r-- | drivers/media/video/zoran/zoran_driver.c | 6 | ||||
-rw-r--r-- | drivers/staging/cx25821/cx25821-video.c | 2 |
15 files changed, 32 insertions, 41 deletions
diff --git a/drivers/media/dvb/ttpci/av7110_v4l.c b/drivers/media/dvb/ttpci/av7110_v4l.c index ac20c5bbfa43..cdd31cae46c4 100644 --- a/drivers/media/dvb/ttpci/av7110_v4l.c +++ b/drivers/media/dvb/ttpci/av7110_v4l.c | |||
@@ -100,6 +100,7 @@ static struct v4l2_input inputs[4] = { | |||
100 | .tuner = 0, /* ignored */ | 100 | .tuner = 0, /* ignored */ |
101 | .std = V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, | 101 | .std = V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, |
102 | .status = 0, | 102 | .status = 0, |
103 | .capabilities = V4L2_IN_CAP_STD, | ||
103 | }, { | 104 | }, { |
104 | .index = 1, | 105 | .index = 1, |
105 | .name = "Television", | 106 | .name = "Television", |
@@ -108,6 +109,7 @@ static struct v4l2_input inputs[4] = { | |||
108 | .tuner = 0, | 109 | .tuner = 0, |
109 | .std = V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, | 110 | .std = V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, |
110 | .status = 0, | 111 | .status = 0, |
112 | .capabilities = V4L2_IN_CAP_STD, | ||
111 | }, { | 113 | }, { |
112 | .index = 2, | 114 | .index = 2, |
113 | .name = "Video", | 115 | .name = "Video", |
@@ -116,6 +118,7 @@ static struct v4l2_input inputs[4] = { | |||
116 | .tuner = 0, | 118 | .tuner = 0, |
117 | .std = V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, | 119 | .std = V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, |
118 | .status = 0, | 120 | .status = 0, |
121 | .capabilities = V4L2_IN_CAP_STD, | ||
119 | }, { | 122 | }, { |
120 | .index = 3, | 123 | .index = 3, |
121 | .name = "Y/C", | 124 | .name = "Y/C", |
@@ -124,6 +127,7 @@ static struct v4l2_input inputs[4] = { | |||
124 | .tuner = 0, | 127 | .tuner = 0, |
125 | .std = V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, | 128 | .std = V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, |
126 | .status = 0, | 129 | .status = 0, |
130 | .capabilities = V4L2_IN_CAP_STD, | ||
127 | } | 131 | } |
128 | }; | 132 | }; |
129 | 133 | ||
diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c index 97afc01f60d0..e957d7690bcc 100644 --- a/drivers/media/dvb/ttpci/budget-av.c +++ b/drivers/media/dvb/ttpci/budget-av.c | |||
@@ -1406,8 +1406,10 @@ static int budget_av_detach(struct saa7146_dev *dev) | |||
1406 | 1406 | ||
1407 | #define KNC1_INPUTS 2 | 1407 | #define KNC1_INPUTS 2 |
1408 | static struct v4l2_input knc1_inputs[KNC1_INPUTS] = { | 1408 | static struct v4l2_input knc1_inputs[KNC1_INPUTS] = { |
1409 | {0, "Composite", V4L2_INPUT_TYPE_TUNER, 1, 0, V4L2_STD_PAL_BG | V4L2_STD_NTSC_M, 0}, | 1409 | { 0, "Composite", V4L2_INPUT_TYPE_TUNER, 1, 0, |
1410 | {1, "S-Video", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG | V4L2_STD_NTSC_M, 0}, | 1410 | V4L2_STD_PAL_BG | V4L2_STD_NTSC_M, 0, V4L2_IN_CAP_STD }, |
1411 | { 1, "S-Video", V4L2_INPUT_TYPE_CAMERA, 2, 0, | ||
1412 | V4L2_STD_PAL_BG | V4L2_STD_NTSC_M, 0, V4L2_IN_CAP_STD }, | ||
1411 | }; | 1413 | }; |
1412 | 1414 | ||
1413 | static int vidioc_enum_input(struct file *file, void *fh, struct v4l2_input *i) | 1415 | static int vidioc_enum_input(struct file *file, void *fh, struct v4l2_input *i) |
diff --git a/drivers/media/video/cx18/cx18-cards.c b/drivers/media/video/cx18/cx18-cards.c index 52ba913b5af8..87177733cf92 100644 --- a/drivers/media/video/cx18/cx18-cards.c +++ b/drivers/media/video/cx18/cx18-cards.c | |||
@@ -546,7 +546,6 @@ int cx18_get_input(struct cx18 *cx, u16 index, struct v4l2_input *input) | |||
546 | "Component 1" | 546 | "Component 1" |
547 | }; | 547 | }; |
548 | 548 | ||
549 | memset(input, 0, sizeof(*input)); | ||
550 | if (index >= cx->nof_inputs) | 549 | if (index >= cx->nof_inputs) |
551 | return -EINVAL; | 550 | return -EINVAL; |
552 | input->index = index; | 551 | input->index = index; |
diff --git a/drivers/media/video/cx23885/cx23885-video.c b/drivers/media/video/cx23885/cx23885-video.c index 796a797b5205..644fcb808c0b 100644 --- a/drivers/media/video/cx23885/cx23885-video.c +++ b/drivers/media/video/cx23885/cx23885-video.c | |||
@@ -1126,7 +1126,6 @@ static int cx23885_enum_input(struct cx23885_dev *dev, struct v4l2_input *i) | |||
1126 | if (0 == INPUT(n)->type) | 1126 | if (0 == INPUT(n)->type) |
1127 | return -EINVAL; | 1127 | return -EINVAL; |
1128 | 1128 | ||
1129 | memset(i, 0, sizeof(*i)); | ||
1130 | i->index = n; | 1129 | i->index = n; |
1131 | i->type = V4L2_INPUT_TYPE_CAMERA; | 1130 | i->type = V4L2_INPUT_TYPE_CAMERA; |
1132 | strcpy(i->name, iname[INPUT(n)->type]); | 1131 | strcpy(i->name, iname[INPUT(n)->type]); |
diff --git a/drivers/media/video/et61x251/et61x251_core.c b/drivers/media/video/et61x251/et61x251_core.c index bb164099ea2c..a982750dcef1 100644 --- a/drivers/media/video/et61x251/et61x251_core.c +++ b/drivers/media/video/et61x251/et61x251_core.c | |||
@@ -1610,6 +1610,7 @@ et61x251_vidioc_enuminput(struct et61x251_device* cam, void __user * arg) | |||
1610 | memset(&i, 0, sizeof(i)); | 1610 | memset(&i, 0, sizeof(i)); |
1611 | strcpy(i.name, "Camera"); | 1611 | strcpy(i.name, "Camera"); |
1612 | i.type = V4L2_INPUT_TYPE_CAMERA; | 1612 | i.type = V4L2_INPUT_TYPE_CAMERA; |
1613 | i.capabilities = V4L2_IN_CAP_STD; | ||
1613 | 1614 | ||
1614 | if (copy_to_user(arg, &i, sizeof(i))) | 1615 | if (copy_to_user(arg, &i, sizeof(i))) |
1615 | return -EFAULT; | 1616 | return -EFAULT; |
diff --git a/drivers/media/video/hexium_gemini.c b/drivers/media/video/hexium_gemini.c index 7ae96367b3ab..cdf8b191f710 100644 --- a/drivers/media/video/hexium_gemini.c +++ b/drivers/media/video/hexium_gemini.c | |||
@@ -37,15 +37,15 @@ static int hexium_num; | |||
37 | 37 | ||
38 | #define HEXIUM_INPUTS 9 | 38 | #define HEXIUM_INPUTS 9 |
39 | static struct v4l2_input hexium_inputs[HEXIUM_INPUTS] = { | 39 | static struct v4l2_input hexium_inputs[HEXIUM_INPUTS] = { |
40 | { 0, "CVBS 1", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 }, | 40 | { 0, "CVBS 1", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0, V4L2_IN_CAP_STD }, |
41 | { 1, "CVBS 2", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 }, | 41 | { 1, "CVBS 2", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0, V4L2_IN_CAP_STD }, |
42 | { 2, "CVBS 3", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 }, | 42 | { 2, "CVBS 3", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0, V4L2_IN_CAP_STD }, |
43 | { 3, "CVBS 4", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 }, | 43 | { 3, "CVBS 4", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0, V4L2_IN_CAP_STD }, |
44 | { 4, "CVBS 5", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 }, | 44 | { 4, "CVBS 5", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0, V4L2_IN_CAP_STD }, |
45 | { 5, "CVBS 6", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 }, | 45 | { 5, "CVBS 6", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0, V4L2_IN_CAP_STD }, |
46 | { 6, "Y/C 1", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 }, | 46 | { 6, "Y/C 1", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0, V4L2_IN_CAP_STD }, |
47 | { 7, "Y/C 2", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 }, | 47 | { 7, "Y/C 2", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0, V4L2_IN_CAP_STD }, |
48 | { 8, "Y/C 3", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 }, | 48 | { 8, "Y/C 3", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0, V4L2_IN_CAP_STD }, |
49 | }; | 49 | }; |
50 | 50 | ||
51 | #define HEXIUM_AUDIOS 0 | 51 | #define HEXIUM_AUDIOS 0 |
diff --git a/drivers/media/video/hexium_orion.c b/drivers/media/video/hexium_orion.c index b72d0f0b8310..6ad7e1c8b922 100644 --- a/drivers/media/video/hexium_orion.c +++ b/drivers/media/video/hexium_orion.c | |||
@@ -38,15 +38,15 @@ static int hexium_num; | |||
38 | 38 | ||
39 | #define HEXIUM_INPUTS 9 | 39 | #define HEXIUM_INPUTS 9 |
40 | static struct v4l2_input hexium_inputs[HEXIUM_INPUTS] = { | 40 | static struct v4l2_input hexium_inputs[HEXIUM_INPUTS] = { |
41 | { 0, "CVBS 1", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 }, | 41 | { 0, "CVBS 1", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0, V4L2_IN_CAP_STD }, |
42 | { 1, "CVBS 2", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 }, | 42 | { 1, "CVBS 2", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0, V4L2_IN_CAP_STD }, |
43 | { 2, "CVBS 3", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 }, | 43 | { 2, "CVBS 3", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0, V4L2_IN_CAP_STD }, |
44 | { 3, "CVBS 4", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 }, | 44 | { 3, "CVBS 4", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0, V4L2_IN_CAP_STD }, |
45 | { 4, "CVBS 5", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 }, | 45 | { 4, "CVBS 5", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0, V4L2_IN_CAP_STD }, |
46 | { 5, "CVBS 6", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 }, | 46 | { 5, "CVBS 6", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0, V4L2_IN_CAP_STD }, |
47 | { 6, "Y/C 1", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 }, | 47 | { 6, "Y/C 1", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0, V4L2_IN_CAP_STD }, |
48 | { 7, "Y/C 2", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 }, | 48 | { 7, "Y/C 2", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0, V4L2_IN_CAP_STD }, |
49 | { 8, "Y/C 3", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 }, | 49 | { 8, "Y/C 3", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0, V4L2_IN_CAP_STD }, |
50 | }; | 50 | }; |
51 | 51 | ||
52 | #define HEXIUM_AUDIOS 0 | 52 | #define HEXIUM_AUDIOS 0 |
diff --git a/drivers/media/video/ivtv/ivtv-cards.c b/drivers/media/video/ivtv/ivtv-cards.c index 87afbbee2063..b6f2a2b42283 100644 --- a/drivers/media/video/ivtv/ivtv-cards.c +++ b/drivers/media/video/ivtv/ivtv-cards.c | |||
@@ -1313,7 +1313,6 @@ int ivtv_get_input(struct ivtv *itv, u16 index, struct v4l2_input *input) | |||
1313 | "Composite 3" | 1313 | "Composite 3" |
1314 | }; | 1314 | }; |
1315 | 1315 | ||
1316 | memset(input, 0, sizeof(*input)); | ||
1317 | if (index >= itv->nof_inputs) | 1316 | if (index >= itv->nof_inputs) |
1318 | return -EINVAL; | 1317 | return -EINVAL; |
1319 | input->index = index; | 1318 | input->index = index; |
@@ -1331,7 +1330,6 @@ int ivtv_get_output(struct ivtv *itv, u16 index, struct v4l2_output *output) | |||
1331 | { | 1330 | { |
1332 | const struct ivtv_card_output *card_output = itv->card->video_outputs + index; | 1331 | const struct ivtv_card_output *card_output = itv->card->video_outputs + index; |
1333 | 1332 | ||
1334 | memset(output, 0, sizeof(*output)); | ||
1335 | if (index >= itv->card->nof_outputs) | 1333 | if (index >= itv->card->nof_outputs) |
1336 | return -EINVAL; | 1334 | return -EINVAL; |
1337 | output->index = index; | 1335 | output->index = index; |
diff --git a/drivers/media/video/mxb.c b/drivers/media/video/mxb.c index 4e8fd965f151..e8846a09b026 100644 --- a/drivers/media/video/mxb.c +++ b/drivers/media/video/mxb.c | |||
@@ -59,10 +59,10 @@ MODULE_PARM_DESC(debug, "Turn on/off device debugging (default:off)."); | |||
59 | enum { TUNER, AUX1, AUX3, AUX3_YC }; | 59 | enum { TUNER, AUX1, AUX3, AUX3_YC }; |
60 | 60 | ||
61 | static struct v4l2_input mxb_inputs[MXB_INPUTS] = { | 61 | static struct v4l2_input mxb_inputs[MXB_INPUTS] = { |
62 | { TUNER, "Tuner", V4L2_INPUT_TYPE_TUNER, 1, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 }, | 62 | { TUNER, "Tuner", V4L2_INPUT_TYPE_TUNER, 1, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0, V4L2_IN_CAP_STD }, |
63 | { AUX1, "AUX1", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 }, | 63 | { AUX1, "AUX1", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0, V4L2_IN_CAP_STD }, |
64 | { AUX3, "AUX3 Composite", V4L2_INPUT_TYPE_CAMERA, 4, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 }, | 64 | { AUX3, "AUX3 Composite", V4L2_INPUT_TYPE_CAMERA, 4, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0, V4L2_IN_CAP_STD }, |
65 | { AUX3_YC, "AUX3 S-Video", V4L2_INPUT_TYPE_CAMERA, 4, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 }, | 65 | { AUX3_YC, "AUX3 S-Video", V4L2_INPUT_TYPE_CAMERA, 4, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0, V4L2_IN_CAP_STD }, |
66 | }; | 66 | }; |
67 | 67 | ||
68 | /* this array holds the information, which port of the saa7146 each | 68 | /* this array holds the information, which port of the saa7146 each |
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c index ee4ea5f001a8..776ba2dd7f9f 100644 --- a/drivers/media/video/saa7134/saa7134-video.c +++ b/drivers/media/video/saa7134/saa7134-video.c | |||
@@ -1748,7 +1748,6 @@ static int saa7134_enum_input(struct file *file, void *priv, | |||
1748 | return -EINVAL; | 1748 | return -EINVAL; |
1749 | if (NULL == card_in(dev, i->index).name) | 1749 | if (NULL == card_in(dev, i->index).name) |
1750 | return -EINVAL; | 1750 | return -EINVAL; |
1751 | memset(i, 0, sizeof(*i)); | ||
1752 | i->index = n; | 1751 | i->index = n; |
1753 | i->type = V4L2_INPUT_TYPE_CAMERA; | 1752 | i->type = V4L2_INPUT_TYPE_CAMERA; |
1754 | strcpy(i->name, card_in(dev, n).name); | 1753 | strcpy(i->name, card_in(dev, n).name); |
diff --git a/drivers/media/video/sn9c102/sn9c102_core.c b/drivers/media/video/sn9c102/sn9c102_core.c index f49fbfb7dc13..84984f64b234 100644 --- a/drivers/media/video/sn9c102/sn9c102_core.c +++ b/drivers/media/video/sn9c102/sn9c102_core.c | |||
@@ -2189,6 +2189,7 @@ sn9c102_vidioc_enuminput(struct sn9c102_device* cam, void __user * arg) | |||
2189 | memset(&i, 0, sizeof(i)); | 2189 | memset(&i, 0, sizeof(i)); |
2190 | strcpy(i.name, "Camera"); | 2190 | strcpy(i.name, "Camera"); |
2191 | i.type = V4L2_INPUT_TYPE_CAMERA; | 2191 | i.type = V4L2_INPUT_TYPE_CAMERA; |
2192 | i.capabilities = V4L2_IN_CAP_STD; | ||
2192 | 2193 | ||
2193 | if (copy_to_user(arg, &i, sizeof(i))) | 2194 | if (copy_to_user(arg, &i, sizeof(i))) |
2194 | return -EFAULT; | 2195 | return -EFAULT; |
diff --git a/drivers/media/video/timblogiw.c b/drivers/media/video/timblogiw.c index 700c08aca6c6..c2fcab465dfc 100644 --- a/drivers/media/video/timblogiw.c +++ b/drivers/media/video/timblogiw.c | |||
@@ -369,7 +369,6 @@ static int timblogiw_enuminput(struct file *file, void *priv, | |||
369 | if (inp->index != 0) | 369 | if (inp->index != 0) |
370 | return -EINVAL; | 370 | return -EINVAL; |
371 | 371 | ||
372 | memset(inp, 0, sizeof(*inp)); | ||
373 | inp->index = 0; | 372 | inp->index = 0; |
374 | 373 | ||
375 | strncpy(inp->name, "Timb input 1", sizeof(inp->name) - 1); | 374 | strncpy(inp->name, "Timb input 1", sizeof(inp->name) - 1); |
diff --git a/drivers/media/video/vino.c b/drivers/media/video/vino.c index 7e7eec48f8b1..d63e9d978493 100644 --- a/drivers/media/video/vino.c +++ b/drivers/media/video/vino.c | |||
@@ -2954,9 +2954,6 @@ static int vino_enum_input(struct file *file, void *__fh, | |||
2954 | if (input == VINO_INPUT_NONE) | 2954 | if (input == VINO_INPUT_NONE) |
2955 | return -EINVAL; | 2955 | return -EINVAL; |
2956 | 2956 | ||
2957 | memset(i, 0, sizeof(struct v4l2_input)); | ||
2958 | |||
2959 | i->index = index; | ||
2960 | i->type = V4L2_INPUT_TYPE_CAMERA; | 2957 | i->type = V4L2_INPUT_TYPE_CAMERA; |
2961 | i->std = vino_inputs[input].std; | 2958 | i->std = vino_inputs[input].std; |
2962 | strcpy(i->name, vino_inputs[input].name); | 2959 | strcpy(i->name, vino_inputs[input].name); |
diff --git a/drivers/media/video/zoran/zoran_driver.c b/drivers/media/video/zoran/zoran_driver.c index 1b67b1914038..fe84f17c65c4 100644 --- a/drivers/media/video/zoran/zoran_driver.c +++ b/drivers/media/video/zoran/zoran_driver.c | |||
@@ -2449,11 +2449,6 @@ static int zoran_enum_input(struct file *file, void *__fh, | |||
2449 | 2449 | ||
2450 | if (inp->index >= zr->card.inputs) | 2450 | if (inp->index >= zr->card.inputs) |
2451 | return -EINVAL; | 2451 | return -EINVAL; |
2452 | else { | ||
2453 | int id = inp->index; | ||
2454 | memset(inp, 0, sizeof(*inp)); | ||
2455 | inp->index = id; | ||
2456 | } | ||
2457 | 2452 | ||
2458 | strncpy(inp->name, zr->card.input[inp->index].name, | 2453 | strncpy(inp->name, zr->card.input[inp->index].name, |
2459 | sizeof(inp->name) - 1); | 2454 | sizeof(inp->name) - 1); |
@@ -2503,7 +2498,6 @@ static int zoran_enum_output(struct file *file, void *__fh, | |||
2503 | if (outp->index != 0) | 2498 | if (outp->index != 0) |
2504 | return -EINVAL; | 2499 | return -EINVAL; |
2505 | 2500 | ||
2506 | memset(outp, 0, sizeof(*outp)); | ||
2507 | outp->index = 0; | 2501 | outp->index = 0; |
2508 | outp->type = V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY; | 2502 | outp->type = V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY; |
2509 | strncpy(outp->name, "Autodetect", sizeof(outp->name)-1); | 2503 | strncpy(outp->name, "Autodetect", sizeof(outp->name)-1); |
diff --git a/drivers/staging/cx25821/cx25821-video.c b/drivers/staging/cx25821/cx25821-video.c index 27406c31d876..998c33acf7bd 100644 --- a/drivers/staging/cx25821/cx25821-video.c +++ b/drivers/staging/cx25821/cx25821-video.c | |||
@@ -1272,8 +1272,6 @@ int cx25821_enum_input(struct cx25821_dev *dev, struct v4l2_input *i) | |||
1272 | if (0 == INPUT(n)->type) | 1272 | if (0 == INPUT(n)->type) |
1273 | return -EINVAL; | 1273 | return -EINVAL; |
1274 | 1274 | ||
1275 | memset(i, 0, sizeof(*i)); | ||
1276 | i->index = n; | ||
1277 | i->type = V4L2_INPUT_TYPE_CAMERA; | 1275 | i->type = V4L2_INPUT_TYPE_CAMERA; |
1278 | strcpy(i->name, iname[INPUT(n)->type]); | 1276 | strcpy(i->name, iname[INPUT(n)->type]); |
1279 | 1277 | ||