aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7164
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-10-11 16:39:06 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-21 05:55:27 -0400
commitc7e242baf73a284eff92444fb58af11439e3a22c (patch)
treedb1fae0f8d0ff85d0218afe1cc1310ba20a067ba /drivers/media/video/saa7164
parent4d270cfb36683f623f2c23f96b695deb1812476e (diff)
[media] saa7134: Fix lots os spaces at the wrong places
There are lots of checkpatch complains about: ERROR: space prohibited after that open parenthesis '(' ERROR: space prohibited after that open square bracket '[' ERROR: space prohibited before that close parenthesis ')' ERROR: space prohibited before that close square bracket ']' This script should fix all of them: for i in drivers/media/video/saa7164/*.[ch]; do cat $i|perl -ne 's/\[\ +(.*)/[$1/; s/\ +\]/$1\]/g; s/\(\ +(.*)/($1/g; s/\ +\)/$1)/g; print $_;' >a && mv a $i; done Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/saa7164')
-rw-r--r--drivers/media/video/saa7164/saa7164-api.c54
-rw-r--r--drivers/media/video/saa7164/saa7164-core.c78
-rw-r--r--drivers/media/video/saa7164/saa7164-encoder.c10
-rw-r--r--drivers/media/video/saa7164/saa7164-types.h2
-rw-r--r--drivers/media/video/saa7164/saa7164-vbi.c10
-rw-r--r--drivers/media/video/saa7164/saa7164.h4
6 files changed, 79 insertions, 79 deletions
diff --git a/drivers/media/video/saa7164/saa7164-api.c b/drivers/media/video/saa7164/saa7164-api.c
index d1cd0f1741a3..ad3bc4154176 100644
--- a/drivers/media/video/saa7164/saa7164-api.c
+++ b/drivers/media/video/saa7164/saa7164-api.c
@@ -424,7 +424,7 @@ int saa7164_api_set_videomux(struct saa7164_port *port)
424 int ret; 424 int ret;
425 425
426 dprintk(DBGLVL_ENC, "%s() v_mux=%d a_mux=%d\n", 426 dprintk(DBGLVL_ENC, "%s() v_mux=%d a_mux=%d\n",
427 __func__, port->mux_input, inputs[ port->mux_input - 1 ]); 427 __func__, port->mux_input, inputs[port->mux_input - 1]);
428 428
429 /* Audio Mute */ 429 /* Audio Mute */
430 ret = saa7164_api_audio_mute(port, 1); 430 ret = saa7164_api_audio_mute(port, 1);
@@ -439,7 +439,7 @@ int saa7164_api_set_videomux(struct saa7164_port *port)
439 439
440 /* Audio Mux */ 440 /* Audio Mux */
441 ret = saa7164_cmd_send(port->dev, port->audfeat.sourceid, SET_CUR, 441 ret = saa7164_cmd_send(port->dev, port->audfeat.sourceid, SET_CUR,
442 SU_INPUT_SELECT_CONTROL, sizeof(u8), &inputs[ port->mux_input - 1 ]); 442 SU_INPUT_SELECT_CONTROL, sizeof(u8), &inputs[port->mux_input - 1]);
443 if (ret != SAA_OK) 443 if (ret != SAA_OK)
444 printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret); 444 printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret);
445 445
@@ -488,7 +488,7 @@ int saa7164_api_set_audio_volume(struct saa7164_port *port, s8 level)
488 printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret); 488 printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret);
489 489
490 ret = saa7164_cmd_send(port->dev, port->audfeat.unitid, GET_CUR, 490 ret = saa7164_cmd_send(port->dev, port->audfeat.unitid, GET_CUR,
491 ( 0x01 << 8) | VOLUME_CONTROL, sizeof(u16), &v); 491 (0x01 << 8) | VOLUME_CONTROL, sizeof(u16), &v);
492 if (ret != SAA_OK) 492 if (ret != SAA_OK)
493 printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret); 493 printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret);
494 494
@@ -502,18 +502,18 @@ int saa7164_api_set_audio_volume(struct saa7164_port *port, s8 level)
502 502
503 /* Left */ 503 /* Left */
504 ret = saa7164_cmd_send(port->dev, port->audfeat.unitid, SET_CUR, 504 ret = saa7164_cmd_send(port->dev, port->audfeat.unitid, SET_CUR,
505 ( 0x01 << 8 ) | VOLUME_CONTROL, sizeof(s16), &v); 505 (0x01 << 8) | VOLUME_CONTROL, sizeof(s16), &v);
506 if (ret != SAA_OK) 506 if (ret != SAA_OK)
507 printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret); 507 printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret);
508 508
509 /* Right */ 509 /* Right */
510 ret = saa7164_cmd_send(port->dev, port->audfeat.unitid, SET_CUR, 510 ret = saa7164_cmd_send(port->dev, port->audfeat.unitid, SET_CUR,
511 ( 0x02 << 8 ) | VOLUME_CONTROL, sizeof(s16), &v); 511 (0x02 << 8) | VOLUME_CONTROL, sizeof(s16), &v);
512 if (ret != SAA_OK) 512 if (ret != SAA_OK)
513 printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret); 513 printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret);
514 514
515 ret = saa7164_cmd_send(port->dev, port->audfeat.unitid, GET_CUR, 515 ret = saa7164_cmd_send(port->dev, port->audfeat.unitid, GET_CUR,
516 ( 0x01 << 8) | VOLUME_CONTROL, sizeof(u16), &v); 516 (0x01 << 8) | VOLUME_CONTROL, sizeof(u16), &v);
517 if (ret != SAA_OK) 517 if (ret != SAA_OK)
518 printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret); 518 printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret);
519 519
@@ -735,16 +735,16 @@ int saa7164_api_initialize_dif(struct saa7164_port *port)
735 } else 735 } else
736 if (port->type == SAA7164_MPEG_DVB) { 736 if (port->type == SAA7164_MPEG_DVB) {
737 if (port->nr == SAA7164_PORT_TS1) 737 if (port->nr == SAA7164_PORT_TS1)
738 p = &dev->ports[ SAA7164_PORT_ENC1 ]; 738 p = &dev->ports[SAA7164_PORT_ENC1];
739 else 739 else
740 p = &dev->ports[ SAA7164_PORT_ENC2 ]; 740 p = &dev->ports[SAA7164_PORT_ENC2];
741 } else 741 } else
742 if (port->type == SAA7164_MPEG_VBI) { 742 if (port->type == SAA7164_MPEG_VBI) {
743 std = V4L2_STD_NTSC; 743 std = V4L2_STD_NTSC;
744 if (port->nr == SAA7164_PORT_VBI1) 744 if (port->nr == SAA7164_PORT_VBI1)
745 p = &dev->ports[ SAA7164_PORT_ENC1 ]; 745 p = &dev->ports[SAA7164_PORT_ENC1];
746 else 746 else
747 p = &dev->ports[ SAA7164_PORT_ENC2 ]; 747 p = &dev->ports[SAA7164_PORT_ENC2];
748 } else 748 } else
749 BUG(); 749 BUG();
750 750
@@ -926,7 +926,7 @@ int saa7164_api_dump_subdevs(struct saa7164_dev *dev, u8 *buf, int len)
926 "%s(?,?,%d) sizeof(struct tmComResDescrHeader) = %d bytes\n", 926 "%s(?,?,%d) sizeof(struct tmComResDescrHeader) = %d bytes\n",
927 __func__, len, (u32)sizeof(struct tmComResDescrHeader)); 927 __func__, len, (u32)sizeof(struct tmComResDescrHeader));
928 928
929 for (idx = 0; idx < (len - sizeof(struct tmComResDescrHeader)); ) { 929 for (idx = 0; idx < (len - sizeof(struct tmComResDescrHeader));) {
930 930
931 hdr = (struct tmComResDescrHeader *)(buf + idx); 931 hdr = (struct tmComResDescrHeader *)(buf + idx);
932 932
@@ -1056,9 +1056,9 @@ int saa7164_api_dump_subdevs(struct saa7164_dev *dev, u8 *buf, int len)
1056 tsfmt = 1056 tsfmt =
1057 (struct tmComResTSFormatDescrHeader *)t; 1057 (struct tmComResTSFormatDescrHeader *)t;
1058 if (currpath == 1) 1058 if (currpath == 1)
1059 tsport = &dev->ports[ SAA7164_PORT_TS1 ]; 1059 tsport = &dev->ports[SAA7164_PORT_TS1];
1060 else 1060 else
1061 tsport = &dev->ports[ SAA7164_PORT_TS2 ]; 1061 tsport = &dev->ports[SAA7164_PORT_TS2];
1062 memcpy(&tsport->hwcfg, vcoutputtermhdr, 1062 memcpy(&tsport->hwcfg, vcoutputtermhdr,
1063 sizeof(*vcoutputtermhdr)); 1063 sizeof(*vcoutputtermhdr));
1064 saa7164_api_configure_port_mpeg2ts(dev, 1064 saa7164_api_configure_port_mpeg2ts(dev,
@@ -1068,9 +1068,9 @@ int saa7164_api_dump_subdevs(struct saa7164_dev *dev, u8 *buf, int len)
1068 psfmt = 1068 psfmt =
1069 (struct tmComResPSFormatDescrHeader *)t; 1069 (struct tmComResPSFormatDescrHeader *)t;
1070 if (currpath == 1) 1070 if (currpath == 1)
1071 encport = &dev->ports[ SAA7164_PORT_ENC1 ]; 1071 encport = &dev->ports[SAA7164_PORT_ENC1];
1072 else 1072 else
1073 encport = &dev->ports[ SAA7164_PORT_ENC2 ]; 1073 encport = &dev->ports[SAA7164_PORT_ENC2];
1074 memcpy(&encport->hwcfg, vcoutputtermhdr, 1074 memcpy(&encport->hwcfg, vcoutputtermhdr,
1075 sizeof(*vcoutputtermhdr)); 1075 sizeof(*vcoutputtermhdr));
1076 saa7164_api_configure_port_mpeg2ps(dev, 1076 saa7164_api_configure_port_mpeg2ps(dev,
@@ -1080,9 +1080,9 @@ int saa7164_api_dump_subdevs(struct saa7164_dev *dev, u8 *buf, int len)
1080 vbifmt = 1080 vbifmt =
1081 (struct tmComResVBIFormatDescrHeader *)t; 1081 (struct tmComResVBIFormatDescrHeader *)t;
1082 if (currpath == 1) 1082 if (currpath == 1)
1083 vbiport = &dev->ports[ SAA7164_PORT_VBI1 ]; 1083 vbiport = &dev->ports[SAA7164_PORT_VBI1];
1084 else 1084 else
1085 vbiport = &dev->ports[ SAA7164_PORT_VBI2 ]; 1085 vbiport = &dev->ports[SAA7164_PORT_VBI2];
1086 memcpy(&vbiport->hwcfg, vcoutputtermhdr, 1086 memcpy(&vbiport->hwcfg, vcoutputtermhdr,
1087 sizeof(*vcoutputtermhdr)); 1087 sizeof(*vcoutputtermhdr));
1088 memcpy(&vbiport->vbi_fmt_ntsc, vbifmt, sizeof(*vbifmt)); 1088 memcpy(&vbiport->vbi_fmt_ntsc, vbifmt, sizeof(*vbifmt));
@@ -1129,9 +1129,9 @@ int saa7164_api_dump_subdevs(struct saa7164_dev *dev, u8 *buf, int len)
1129 1129
1130 if (tunerunithdr->unitid == tunerunithdr->iunit) { 1130 if (tunerunithdr->unitid == tunerunithdr->iunit) {
1131 if (currpath == 1) 1131 if (currpath == 1)
1132 encport = &dev->ports[ SAA7164_PORT_ENC1 ]; 1132 encport = &dev->ports[SAA7164_PORT_ENC1];
1133 else 1133 else
1134 encport = &dev->ports[ SAA7164_PORT_ENC2 ]; 1134 encport = &dev->ports[SAA7164_PORT_ENC2];
1135 memcpy(&encport->tunerunit, tunerunithdr, 1135 memcpy(&encport->tunerunit, tunerunithdr,
1136 sizeof(struct tmComResTunerDescrHeader)); 1136 sizeof(struct tmComResTunerDescrHeader));
1137 dprintk(DBGLVL_API, " (becomes dev->enc[%d] tuner)\n", encport->nr); 1137 dprintk(DBGLVL_API, " (becomes dev->enc[%d] tuner)\n", encport->nr);
@@ -1158,9 +1158,9 @@ int saa7164_api_dump_subdevs(struct saa7164_dev *dev, u8 *buf, int len)
1158 pdh->controlsize); 1158 pdh->controlsize);
1159 if (pdh->controlsize == 0x04) { 1159 if (pdh->controlsize == 0x04) {
1160 if (currpath == 1) 1160 if (currpath == 1)
1161 encport = &dev->ports[ SAA7164_PORT_ENC1 ]; 1161 encport = &dev->ports[SAA7164_PORT_ENC1];
1162 else 1162 else
1163 encport = &dev->ports[ SAA7164_PORT_ENC2 ]; 1163 encport = &dev->ports[SAA7164_PORT_ENC2];
1164 memcpy(&encport->vidproc, pdh, 1164 memcpy(&encport->vidproc, pdh,
1165 sizeof(struct tmComResProcDescrHeader)); 1165 sizeof(struct tmComResProcDescrHeader));
1166 dprintk(DBGLVL_API, " (becomes dev->enc[%d])\n", encport->nr); 1166 dprintk(DBGLVL_API, " (becomes dev->enc[%d])\n", encport->nr);
@@ -1176,9 +1176,9 @@ int saa7164_api_dump_subdevs(struct saa7164_dev *dev, u8 *buf, int len)
1176 dprintk(DBGLVL_API, " controlsize = 0x%x\n", 1176 dprintk(DBGLVL_API, " controlsize = 0x%x\n",
1177 afd->controlsize); 1177 afd->controlsize);
1178 if (currpath == 1) 1178 if (currpath == 1)
1179 encport = &dev->ports[ SAA7164_PORT_ENC1 ]; 1179 encport = &dev->ports[SAA7164_PORT_ENC1];
1180 else 1180 else
1181 encport = &dev->ports[ SAA7164_PORT_ENC2 ]; 1181 encport = &dev->ports[SAA7164_PORT_ENC2];
1182 memcpy(&encport->audfeat, afd, 1182 memcpy(&encport->audfeat, afd,
1183 sizeof(struct tmComResAFeatureDescrHeader)); 1183 sizeof(struct tmComResAFeatureDescrHeader));
1184 dprintk(DBGLVL_API, " (becomes dev->enc[%d])\n", encport->nr); 1184 dprintk(DBGLVL_API, " (becomes dev->enc[%d])\n", encport->nr);
@@ -1193,9 +1193,9 @@ int saa7164_api_dump_subdevs(struct saa7164_dev *dev, u8 *buf, int len)
1193 dprintk(DBGLVL_API, " iunit = 0x%x\n", edh->iunit); 1193 dprintk(DBGLVL_API, " iunit = 0x%x\n", edh->iunit);
1194 if (edh->iunit == edh->unitid) { 1194 if (edh->iunit == edh->unitid) {
1195 if (currpath == 1) 1195 if (currpath == 1)
1196 encport = &dev->ports[ SAA7164_PORT_ENC1 ]; 1196 encport = &dev->ports[SAA7164_PORT_ENC1];
1197 else 1197 else
1198 encport = &dev->ports[ SAA7164_PORT_ENC2 ]; 1198 encport = &dev->ports[SAA7164_PORT_ENC2];
1199 memcpy(&encport->encunit, edh, 1199 memcpy(&encport->encunit, edh,
1200 sizeof(struct tmComResEncoderDescrHeader)); 1200 sizeof(struct tmComResEncoderDescrHeader));
1201 dprintk(DBGLVL_API, " (becomes dev->enc[%d])\n", encport->nr); 1201 dprintk(DBGLVL_API, " (becomes dev->enc[%d])\n", encport->nr);
@@ -1257,9 +1257,9 @@ int saa7164_api_dump_subdevs(struct saa7164_dev *dev, u8 *buf, int len)
1257 exthdr->controlsize); 1257 exthdr->controlsize);
1258 if (exthdr->devicetype & 0x80) { 1258 if (exthdr->devicetype & 0x80) {
1259 if (currpath == 1) 1259 if (currpath == 1)
1260 encport = &dev->ports[ SAA7164_PORT_ENC1 ]; 1260 encport = &dev->ports[SAA7164_PORT_ENC1];
1261 else 1261 else
1262 encport = &dev->ports[ SAA7164_PORT_ENC2 ]; 1262 encport = &dev->ports[SAA7164_PORT_ENC2];
1263 memcpy(&encport->ifunit, exthdr, 1263 memcpy(&encport->ifunit, exthdr,
1264 sizeof(struct tmComResExtDevDescrHeader)); 1264 sizeof(struct tmComResExtDevDescrHeader));
1265 dprintk(DBGLVL_API, " (becomes dev->enc[%d])\n", encport->nr); 1265 dprintk(DBGLVL_API, " (becomes dev->enc[%d])\n", encport->nr);
diff --git a/drivers/media/video/saa7164/saa7164-core.c b/drivers/media/video/saa7164/saa7164-core.c
index 46c2fb2ecf5e..e1bac5051460 100644
--- a/drivers/media/video/saa7164/saa7164-core.c
+++ b/drivers/media/video/saa7164/saa7164-core.c
@@ -120,8 +120,8 @@ static void saa7164_pack_verifier(struct saa7164_buffer *buf)
120 120
121 for (i = 0; i < buf->actual_size; i += 2048) { 121 for (i = 0; i < buf->actual_size; i += 2048) {
122 122
123 if ( (*(p + i + 0) != 0x00) || (*(p + i + 1) != 0x00) || 123 if ((*(p + i + 0) != 0x00) || (*(p + i + 1) != 0x00) ||
124 (*(p + i + 2) != 0x01) || (*(p + i + 3) != 0xBA) ) { 124 (*(p + i + 2) != 0x01) || (*(p + i + 3) != 0xBA)) {
125 printk(KERN_ERR "No pack at 0x%x\n", i); 125 printk(KERN_ERR "No pack at 0x%x\n", i);
126// saa7164_dumphex16FF(buf->port->dev, (p + i), 32); 126// saa7164_dumphex16FF(buf->port->dev, (p + i), 32);
127 } 127 }
@@ -244,7 +244,7 @@ static void saa7164_histogram_reset(struct saa7164_histogram *hg, char *name)
244void saa7164_histogram_update(struct saa7164_histogram *hg, u32 val) 244void saa7164_histogram_update(struct saa7164_histogram *hg, u32 val)
245{ 245{
246 int i; 246 int i;
247 for (i = 0; i < 64; i++ ) { 247 for (i = 0; i < 64; i++) {
248 if (val <= hg->counter1[i].val) { 248 if (val <= hg->counter1[i].val) {
249 hg->counter1[i].count++; 249 hg->counter1[i].count++;
250 hg->counter1[i].update_time = jiffies; 250 hg->counter1[i].update_time = jiffies;
@@ -260,7 +260,7 @@ static void saa7164_histogram_print(struct saa7164_port *port,
260 int i; 260 int i;
261 261
262 printk(KERN_ERR "Histogram named %s (ms, count, last_update_jiffy)\n", hg->name); 262 printk(KERN_ERR "Histogram named %s (ms, count, last_update_jiffy)\n", hg->name);
263 for (i = 0; i < 64; i++ ) { 263 for (i = 0; i < 64; i++) {
264 if (hg->counter1[i].count == 0) 264 if (hg->counter1[i].count == 0)
265 continue; 265 continue;
266 266
@@ -305,14 +305,14 @@ static void saa7164_work_enchandler_helper(struct saa7164_port *port, int bufnr)
305 305
306 if (guard_checking) { 306 if (guard_checking) {
307 p = (u8 *)buf->cpu; 307 p = (u8 *)buf->cpu;
308 if ( (*(p + buf->actual_size + 0) != 0xff) || 308 if ((*(p + buf->actual_size + 0) != 0xff) ||
309 (*(p + buf->actual_size + 1) != 0xff) || 309 (*(p + buf->actual_size + 1) != 0xff) ||
310 (*(p + buf->actual_size + 2) != 0xff) || 310 (*(p + buf->actual_size + 2) != 0xff) ||
311 (*(p + buf->actual_size + 3) != 0xff) || 311 (*(p + buf->actual_size + 3) != 0xff) ||
312 (*(p + buf->actual_size + 0x10) != 0xff) || 312 (*(p + buf->actual_size + 0x10) != 0xff) ||
313 (*(p + buf->actual_size + 0x11) != 0xff) || 313 (*(p + buf->actual_size + 0x11) != 0xff) ||
314 (*(p + buf->actual_size + 0x12) != 0xff) || 314 (*(p + buf->actual_size + 0x12) != 0xff) ||
315 (*(p + buf->actual_size + 0x13) != 0xff) ) { 315 (*(p + buf->actual_size + 0x13) != 0xff)) {
316 printk(KERN_ERR "%s() buf %p guard buffer breach\n", 316 printk(KERN_ERR "%s() buf %p guard buffer breach\n",
317 __func__, buf); 317 __func__, buf);
318// saa7164_dumphex16FF(dev, (p + buf->actual_size) - 32 , 64); 318// saa7164_dumphex16FF(dev, (p + buf->actual_size) - 32 , 64);
@@ -637,12 +637,12 @@ static irqreturn_t saa7164_irq_ts(struct saa7164_port *port)
637static irqreturn_t saa7164_irq(int irq, void *dev_id) 637static irqreturn_t saa7164_irq(int irq, void *dev_id)
638{ 638{
639 struct saa7164_dev *dev = dev_id; 639 struct saa7164_dev *dev = dev_id;
640 struct saa7164_port *porta = &dev->ports[ SAA7164_PORT_TS1 ]; 640 struct saa7164_port *porta = &dev->ports[SAA7164_PORT_TS1];
641 struct saa7164_port *portb = &dev->ports[ SAA7164_PORT_TS2 ]; 641 struct saa7164_port *portb = &dev->ports[SAA7164_PORT_TS2];
642 struct saa7164_port *portc = &dev->ports[ SAA7164_PORT_ENC1 ]; 642 struct saa7164_port *portc = &dev->ports[SAA7164_PORT_ENC1];
643 struct saa7164_port *portd = &dev->ports[ SAA7164_PORT_ENC2 ]; 643 struct saa7164_port *portd = &dev->ports[SAA7164_PORT_ENC2];
644 struct saa7164_port *porte = &dev->ports[ SAA7164_PORT_VBI1 ]; 644 struct saa7164_port *porte = &dev->ports[SAA7164_PORT_VBI1];
645 struct saa7164_port *portf = &dev->ports[ SAA7164_PORT_VBI2 ]; 645 struct saa7164_port *portf = &dev->ports[SAA7164_PORT_VBI2];
646 646
647 u32 intid, intstat[INT_SIZE/4]; 647 u32 intid, intstat[INT_SIZE/4];
648 int i, handled = 0, bit; 648 int i, handled = 0, bit;
@@ -948,7 +948,7 @@ static int saa7164_port_init(struct saa7164_dev *dev, int portnr)
948 if ((portnr < 0) || (portnr >= SAA7164_MAX_PORTS)) 948 if ((portnr < 0) || (portnr >= SAA7164_MAX_PORTS))
949 BUG(); 949 BUG();
950 950
951 port = &dev->ports[ portnr ]; 951 port = &dev->ports[portnr];
952 952
953 port->dev = dev; 953 port->dev = dev;
954 port->nr = portnr; 954 port->nr = portnr;
@@ -1339,7 +1339,7 @@ static int __devinit saa7164_initdev(struct pci_dev *pci_dev,
1339 1339
1340 /* Begin to create the video sub-systems and register funcs */ 1340 /* Begin to create the video sub-systems and register funcs */
1341 if (saa7164_boards[dev->board].porta == SAA7164_MPEG_DVB) { 1341 if (saa7164_boards[dev->board].porta == SAA7164_MPEG_DVB) {
1342 if (saa7164_dvb_register(&dev->ports[ SAA7164_PORT_TS1 ]) < 0) { 1342 if (saa7164_dvb_register(&dev->ports[SAA7164_PORT_TS1]) < 0) {
1343 printk(KERN_ERR "%s() Failed to register " 1343 printk(KERN_ERR "%s() Failed to register "
1344 "dvb adapters on porta\n", 1344 "dvb adapters on porta\n",
1345 __func__); 1345 __func__);
@@ -1347,7 +1347,7 @@ static int __devinit saa7164_initdev(struct pci_dev *pci_dev,
1347 } 1347 }
1348 1348
1349 if (saa7164_boards[dev->board].portb == SAA7164_MPEG_DVB) { 1349 if (saa7164_boards[dev->board].portb == SAA7164_MPEG_DVB) {
1350 if (saa7164_dvb_register(&dev->ports[ SAA7164_PORT_TS2 ]) < 0) { 1350 if (saa7164_dvb_register(&dev->ports[SAA7164_PORT_TS2]) < 0) {
1351 printk(KERN_ERR"%s() Failed to register " 1351 printk(KERN_ERR"%s() Failed to register "
1352 "dvb adapters on portb\n", 1352 "dvb adapters on portb\n",
1353 __func__); 1353 __func__);
@@ -1355,28 +1355,28 @@ static int __devinit saa7164_initdev(struct pci_dev *pci_dev,
1355 } 1355 }
1356 1356
1357 if (saa7164_boards[dev->board].portc == SAA7164_MPEG_ENCODER) { 1357 if (saa7164_boards[dev->board].portc == SAA7164_MPEG_ENCODER) {
1358 if (saa7164_encoder_register(&dev->ports[ SAA7164_PORT_ENC1 ]) < 0) { 1358 if (saa7164_encoder_register(&dev->ports[SAA7164_PORT_ENC1]) < 0) {
1359 printk(KERN_ERR"%s() Failed to register " 1359 printk(KERN_ERR"%s() Failed to register "
1360 "mpeg encoder\n", __func__); 1360 "mpeg encoder\n", __func__);
1361 } 1361 }
1362 } 1362 }
1363 1363
1364 if (saa7164_boards[dev->board].portd == SAA7164_MPEG_ENCODER) { 1364 if (saa7164_boards[dev->board].portd == SAA7164_MPEG_ENCODER) {
1365 if (saa7164_encoder_register(&dev->ports[ SAA7164_PORT_ENC2 ]) < 0) { 1365 if (saa7164_encoder_register(&dev->ports[SAA7164_PORT_ENC2]) < 0) {
1366 printk(KERN_ERR"%s() Failed to register " 1366 printk(KERN_ERR"%s() Failed to register "
1367 "mpeg encoder\n", __func__); 1367 "mpeg encoder\n", __func__);
1368 } 1368 }
1369 } 1369 }
1370 1370
1371 if (saa7164_boards[dev->board].porte == SAA7164_MPEG_VBI) { 1371 if (saa7164_boards[dev->board].porte == SAA7164_MPEG_VBI) {
1372 if (saa7164_vbi_register(&dev->ports[ SAA7164_PORT_VBI1 ]) < 0) { 1372 if (saa7164_vbi_register(&dev->ports[SAA7164_PORT_VBI1]) < 0) {
1373 printk(KERN_ERR"%s() Failed to register " 1373 printk(KERN_ERR"%s() Failed to register "
1374 "vbi device\n", __func__); 1374 "vbi device\n", __func__);
1375 } 1375 }
1376 } 1376 }
1377 1377
1378 if (saa7164_boards[dev->board].portf == SAA7164_MPEG_VBI) { 1378 if (saa7164_boards[dev->board].portf == SAA7164_MPEG_VBI) {
1379 if (saa7164_vbi_register(&dev->ports[ SAA7164_PORT_VBI2 ]) < 0) { 1379 if (saa7164_vbi_register(&dev->ports[SAA7164_PORT_VBI2]) < 0) {
1380 printk(KERN_ERR"%s() Failed to register " 1380 printk(KERN_ERR"%s() Failed to register "
1381 "vbi device\n", __func__); 1381 "vbi device\n", __func__);
1382 } 1382 }
@@ -1427,40 +1427,40 @@ static void __devexit saa7164_finidev(struct pci_dev *pci_dev)
1427 saa7164_api_set_debug(dev, 0x00); 1427 saa7164_api_set_debug(dev, 0x00);
1428 } 1428 }
1429 1429
1430 saa7164_histogram_print(&dev->ports[ SAA7164_PORT_ENC1 ], 1430 saa7164_histogram_print(&dev->ports[SAA7164_PORT_ENC1],
1431 &dev->ports[ SAA7164_PORT_ENC1 ].irq_interval); 1431 &dev->ports[SAA7164_PORT_ENC1].irq_interval);
1432 saa7164_histogram_print(&dev->ports[ SAA7164_PORT_ENC1 ], 1432 saa7164_histogram_print(&dev->ports[SAA7164_PORT_ENC1],
1433 &dev->ports[ SAA7164_PORT_ENC1 ].svc_interval); 1433 &dev->ports[SAA7164_PORT_ENC1].svc_interval);
1434 saa7164_histogram_print(&dev->ports[ SAA7164_PORT_ENC1 ], 1434 saa7164_histogram_print(&dev->ports[SAA7164_PORT_ENC1],
1435 &dev->ports[ SAA7164_PORT_ENC1 ].irq_svc_interval); 1435 &dev->ports[SAA7164_PORT_ENC1].irq_svc_interval);
1436 saa7164_histogram_print(&dev->ports[ SAA7164_PORT_ENC1 ], 1436 saa7164_histogram_print(&dev->ports[SAA7164_PORT_ENC1],
1437 &dev->ports[ SAA7164_PORT_ENC1 ].read_interval); 1437 &dev->ports[SAA7164_PORT_ENC1].read_interval);
1438 saa7164_histogram_print(&dev->ports[ SAA7164_PORT_ENC1 ], 1438 saa7164_histogram_print(&dev->ports[SAA7164_PORT_ENC1],
1439 &dev->ports[ SAA7164_PORT_ENC1 ].poll_interval); 1439 &dev->ports[SAA7164_PORT_ENC1].poll_interval);
1440 saa7164_histogram_print(&dev->ports[ SAA7164_PORT_VBI1 ], 1440 saa7164_histogram_print(&dev->ports[SAA7164_PORT_VBI1],
1441 &dev->ports[ SAA7164_PORT_VBI1 ].read_interval); 1441 &dev->ports[SAA7164_PORT_VBI1].read_interval);
1442 saa7164_histogram_print(&dev->ports[ SAA7164_PORT_VBI2 ], 1442 saa7164_histogram_print(&dev->ports[SAA7164_PORT_VBI2],
1443 &dev->ports[ SAA7164_PORT_VBI2 ].poll_interval); 1443 &dev->ports[SAA7164_PORT_VBI2].poll_interval);
1444 1444
1445 saa7164_shutdown(dev); 1445 saa7164_shutdown(dev);
1446 1446
1447 if (saa7164_boards[dev->board].porta == SAA7164_MPEG_DVB) 1447 if (saa7164_boards[dev->board].porta == SAA7164_MPEG_DVB)
1448 saa7164_dvb_unregister(&dev->ports[ SAA7164_PORT_TS1 ]); 1448 saa7164_dvb_unregister(&dev->ports[SAA7164_PORT_TS1]);
1449 1449
1450 if (saa7164_boards[dev->board].portb == SAA7164_MPEG_DVB) 1450 if (saa7164_boards[dev->board].portb == SAA7164_MPEG_DVB)
1451 saa7164_dvb_unregister(&dev->ports[ SAA7164_PORT_TS2 ]); 1451 saa7164_dvb_unregister(&dev->ports[SAA7164_PORT_TS2]);
1452 1452
1453 if (saa7164_boards[dev->board].portc == SAA7164_MPEG_ENCODER) 1453 if (saa7164_boards[dev->board].portc == SAA7164_MPEG_ENCODER)
1454 saa7164_encoder_unregister(&dev->ports[ SAA7164_PORT_ENC1 ]); 1454 saa7164_encoder_unregister(&dev->ports[SAA7164_PORT_ENC1]);
1455 1455
1456 if (saa7164_boards[dev->board].portd == SAA7164_MPEG_ENCODER) 1456 if (saa7164_boards[dev->board].portd == SAA7164_MPEG_ENCODER)
1457 saa7164_encoder_unregister(&dev->ports[ SAA7164_PORT_ENC2 ]); 1457 saa7164_encoder_unregister(&dev->ports[SAA7164_PORT_ENC2]);
1458 1458
1459 if (saa7164_boards[dev->board].porte == SAA7164_MPEG_VBI) 1459 if (saa7164_boards[dev->board].porte == SAA7164_MPEG_VBI)
1460 saa7164_vbi_unregister(&dev->ports[ SAA7164_PORT_VBI1 ]); 1460 saa7164_vbi_unregister(&dev->ports[SAA7164_PORT_VBI1]);
1461 1461
1462 if (saa7164_boards[dev->board].portf == SAA7164_MPEG_VBI) 1462 if (saa7164_boards[dev->board].portf == SAA7164_MPEG_VBI)
1463 saa7164_vbi_unregister(&dev->ports[ SAA7164_PORT_VBI2 ]); 1463 saa7164_vbi_unregister(&dev->ports[SAA7164_PORT_VBI2]);
1464 1464
1465 saa7164_i2c_unregister(&dev->i2c_bus[0]); 1465 saa7164_i2c_unregister(&dev->i2c_bus[0]);
1466 saa7164_i2c_unregister(&dev->i2c_bus[1]); 1466 saa7164_i2c_unregister(&dev->i2c_bus[1]);
diff --git a/drivers/media/video/saa7164/saa7164-encoder.c b/drivers/media/video/saa7164/saa7164-encoder.c
index 28cf223e571f..2e7d2856d39b 100644
--- a/drivers/media/video/saa7164/saa7164-encoder.c
+++ b/drivers/media/video/saa7164/saa7164-encoder.c
@@ -244,7 +244,7 @@ static int vidioc_enum_input(struct file *file, void *priv,
244 if (i->index >= 7) 244 if (i->index >= 7)
245 return -EINVAL; 245 return -EINVAL;
246 246
247 strcpy(i->name, inputs[ i->index ]); 247 strcpy(i->name, inputs[i->index]);
248 248
249 if (i->index == 0) 249 if (i->index == 0)
250 i->type = V4L2_INPUT_TYPE_TUNER; 250 i->type = V4L2_INPUT_TYPE_TUNER;
@@ -361,10 +361,10 @@ static int vidioc_s_frequency(struct file *file, void *priv,
361 361
362 /* Update the hardware */ 362 /* Update the hardware */
363 if (port->nr == SAA7164_PORT_ENC1) 363 if (port->nr == SAA7164_PORT_ENC1)
364 tsport = &dev->ports[ SAA7164_PORT_TS1 ]; 364 tsport = &dev->ports[SAA7164_PORT_TS1];
365 else 365 else
366 if (port->nr == SAA7164_PORT_ENC2) 366 if (port->nr == SAA7164_PORT_ENC2)
367 tsport = &dev->ports[ SAA7164_PORT_TS2 ]; 367 tsport = &dev->ports[SAA7164_PORT_TS2];
368 else 368 else
369 BUG(); 369 BUG();
370 370
@@ -1070,8 +1070,8 @@ static int fops_open(struct file *file)
1070 list_for_each(list, &saa7164_devlist) { 1070 list_for_each(list, &saa7164_devlist) {
1071 h = list_entry(list, struct saa7164_dev, devlist); 1071 h = list_entry(list, struct saa7164_dev, devlist);
1072 1072
1073 portc = &h->ports[ SAA7164_PORT_ENC1 ]; 1073 portc = &h->ports[SAA7164_PORT_ENC1];
1074 portd = &h->ports[ SAA7164_PORT_ENC2 ]; 1074 portd = &h->ports[SAA7164_PORT_ENC2];
1075 1075
1076 if (portc->v4l_device && 1076 if (portc->v4l_device &&
1077 portc->v4l_device->minor == minor) { 1077 portc->v4l_device->minor == minor) {
diff --git a/drivers/media/video/saa7164/saa7164-types.h b/drivers/media/video/saa7164/saa7164-types.h
index 9690d44ec34f..df1d2997fa6c 100644
--- a/drivers/media/video/saa7164/saa7164-types.h
+++ b/drivers/media/video/saa7164/saa7164-types.h
@@ -328,7 +328,7 @@ struct tmComResEncVideoInputAspectRatio {
328/* 1. IPPPPPPPPPPPPPP */ 328/* 1. IPPPPPPPPPPPPPP */
329/* 2. IBPBPBPBPBPBPBP */ 329/* 2. IBPBPBPBPBPBPBP */
330/* 3. IBBPBBPBBPBBP */ 330/* 3. IBBPBBPBBPBBP */
331#define SAA7164_ENCODER_DEFAULT_GOP_DIST ( 1) 331#define SAA7164_ENCODER_DEFAULT_GOP_DIST (1)
332#define SAA7164_ENCODER_DEFAULT_GOP_SIZE (15) 332#define SAA7164_ENCODER_DEFAULT_GOP_SIZE (15)
333struct tmComResEncVideoGopStructure { 333struct tmComResEncVideoGopStructure {
334 u8 ucGOPSize; /* GOP Size 12, 15 */ 334 u8 ucGOPSize; /* GOP Size 12, 15 */
diff --git a/drivers/media/video/saa7164/saa7164-vbi.c b/drivers/media/video/saa7164/saa7164-vbi.c
index 6f6ea52a48b1..651f40409ae0 100644
--- a/drivers/media/video/saa7164/saa7164-vbi.c
+++ b/drivers/media/video/saa7164/saa7164-vbi.c
@@ -218,7 +218,7 @@ static int vidioc_enum_input(struct file *file, void *priv,
218 if (i->index >= 7) 218 if (i->index >= 7)
219 return -EINVAL; 219 return -EINVAL;
220 220
221 strcpy(i->name, inputs[ i->index ]); 221 strcpy(i->name, inputs[i->index]);
222 222
223 if (i->index == 0) 223 if (i->index == 0)
224 i->type = V4L2_INPUT_TYPE_TUNER; 224 i->type = V4L2_INPUT_TYPE_TUNER;
@@ -335,10 +335,10 @@ static int vidioc_s_frequency(struct file *file, void *priv,
335 335
336 /* Update the hardware */ 336 /* Update the hardware */
337 if (port->nr == SAA7164_PORT_VBI1) 337 if (port->nr == SAA7164_PORT_VBI1)
338 tsport = &dev->ports[ SAA7164_PORT_TS1 ]; 338 tsport = &dev->ports[SAA7164_PORT_TS1];
339 else 339 else
340 if (port->nr == SAA7164_PORT_VBI2) 340 if (port->nr == SAA7164_PORT_VBI2)
341 tsport = &dev->ports[ SAA7164_PORT_TS2 ]; 341 tsport = &dev->ports[SAA7164_PORT_TS2];
342 else 342 else
343 BUG(); 343 BUG();
344 344
@@ -1017,8 +1017,8 @@ static int fops_open(struct file *file)
1017 list_for_each(list, &saa7164_devlist) { 1017 list_for_each(list, &saa7164_devlist) {
1018 h = list_entry(list, struct saa7164_dev, devlist); 1018 h = list_entry(list, struct saa7164_dev, devlist);
1019 1019
1020 porte = &h->ports[ SAA7164_PORT_VBI1 ]; 1020 porte = &h->ports[SAA7164_PORT_VBI1];
1021 portf = &h->ports[ SAA7164_PORT_VBI2 ]; 1021 portf = &h->ports[SAA7164_PORT_VBI2];
1022 1022
1023 if (porte->v4l_device && 1023 if (porte->v4l_device &&
1024 porte->v4l_device->minor == minor) { 1024 porte->v4l_device->minor == minor) {
diff --git a/drivers/media/video/saa7164/saa7164.h b/drivers/media/video/saa7164/saa7164.h
index 99eb94254a1a..1d9c5cbbbc52 100644
--- a/drivers/media/video/saa7164/saa7164.h
+++ b/drivers/media/video/saa7164/saa7164.h
@@ -114,7 +114,7 @@
114#define DBGLVL_THR 4096 114#define DBGLVL_THR 4096
115#define DBGLVL_CPU 8192 115#define DBGLVL_CPU 8192
116 116
117#define SAA7164_NORMS ( V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_JP | V4L2_STD_NTSC_443 ) 117#define SAA7164_NORMS (V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_JP | V4L2_STD_NTSC_443)
118 118
119enum port_t { 119enum port_t {
120 SAA7164_MPEG_UNDEFINED = 0, 120 SAA7164_MPEG_UNDEFINED = 0,
@@ -471,7 +471,7 @@ struct saa7164_dev {
471 struct saa7164_i2c i2c_bus[3]; 471 struct saa7164_i2c i2c_bus[3];
472 472
473 /* Transport related */ 473 /* Transport related */
474 struct saa7164_port ports[ SAA7164_MAX_PORTS ]; 474 struct saa7164_port ports[SAA7164_MAX_PORTS];
475 475
476 /* Deferred command/api interrupts handling */ 476 /* Deferred command/api interrupts handling */
477 struct work_struct workcmd; 477 struct work_struct workcmd;