diff options
author | Steven Toth <stoth@kernellabs.com> | 2010-07-31 14:55:22 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-21 05:55:00 -0400 |
commit | 7c1618227e6932fcd92597507ee63c01da73e623 (patch) | |
tree | a05c3d9dfc40c71d005ff9071a828a1b45a33ed6 /drivers/media/video/saa7164 | |
parent | cfbaf33733b99d214d5616dcb48a690630c19d65 (diff) |
[media] saa7164: code cleanup
Removed some previous debugging code, whitespace cleanup and
spurious comments.
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/saa7164')
-rw-r--r-- | drivers/media/video/saa7164/saa7164-buffer.c | 1 | ||||
-rw-r--r-- | drivers/media/video/saa7164/saa7164-core.c | 39 | ||||
-rw-r--r-- | drivers/media/video/saa7164/saa7164-encoder.c | 8 | ||||
-rw-r--r-- | drivers/media/video/saa7164/saa7164.h | 8 |
4 files changed, 1 insertions, 55 deletions
diff --git a/drivers/media/video/saa7164/saa7164-buffer.c b/drivers/media/video/saa7164/saa7164-buffer.c index c7bd81e248f6..5f45ea7f3d7c 100644 --- a/drivers/media/video/saa7164/saa7164-buffer.c +++ b/drivers/media/video/saa7164/saa7164-buffer.c | |||
@@ -241,7 +241,6 @@ int saa7164_buffer_cfg_port(struct saa7164_port *port) | |||
241 | 241 | ||
242 | dprintk(DBGLVL_BUF, "%s(port=%d)\n", __func__, port->nr); | 242 | dprintk(DBGLVL_BUF, "%s(port=%d)\n", __func__, port->nr); |
243 | 243 | ||
244 | port->counter = 0; | ||
245 | saa7164_writel(port->bufcounter, 0); | 244 | saa7164_writel(port->bufcounter, 0); |
246 | saa7164_writel(port->pitch, params->pitch); | 245 | saa7164_writel(port->pitch, params->pitch); |
247 | saa7164_writel(port->bufsize, params->pitch * params->numberoflines); | 246 | saa7164_writel(port->bufsize, params->pitch * params->numberoflines); |
diff --git a/drivers/media/video/saa7164/saa7164-core.c b/drivers/media/video/saa7164/saa7164-core.c index eb9c3459bb10..b54b032d56b6 100644 --- a/drivers/media/video/saa7164/saa7164-core.c +++ b/drivers/media/video/saa7164/saa7164-core.c | |||
@@ -363,10 +363,6 @@ static void saa7164_work_enchandler(struct work_struct *w) | |||
363 | printk(KERN_ERR "%s() illegal rp count %d\n", __func__, rp); | 363 | printk(KERN_ERR "%s() illegal rp count %d\n", __func__, rp); |
364 | break; | 364 | break; |
365 | } | 365 | } |
366 | |||
367 | /* Process a buffer */ | ||
368 | if (port->nr == SAA7164_PORT_ENC1) | ||
369 | printk(KERN_ERR "Port enc1 processing buffer %d\n", rp); | ||
370 | saa7164_work_enchandler_helper(port, rp); | 366 | saa7164_work_enchandler_helper(port, rp); |
371 | port->last_svc_rp = rp; | 367 | port->last_svc_rp = rp; |
372 | cnt++; | 368 | cnt++; |
@@ -375,15 +371,13 @@ static void saa7164_work_enchandler(struct work_struct *w) | |||
375 | break; | 371 | break; |
376 | } | 372 | } |
377 | 373 | ||
378 | if (port->nr == SAA7164_PORT_ENC1) | ||
379 | printk(KERN_ERR "Enc1 processed %d buffers for port %p\n", cnt, port); | ||
380 | |||
381 | if (print_histogram == port->nr) { | 374 | if (print_histogram == port->nr) { |
382 | saa7164_histogram_print(port, &port->irq_interval); | 375 | saa7164_histogram_print(port, &port->irq_interval); |
383 | saa7164_histogram_print(port, &port->svc_interval); | 376 | saa7164_histogram_print(port, &port->svc_interval); |
384 | saa7164_histogram_print(port, &port->irq_svc_interval); | 377 | saa7164_histogram_print(port, &port->irq_svc_interval); |
385 | saa7164_histogram_print(port, &port->read_interval); | 378 | saa7164_histogram_print(port, &port->read_interval); |
386 | saa7164_histogram_print(port, &port->poll_interval); | 379 | saa7164_histogram_print(port, &port->poll_interval); |
380 | /* TODO: fix this to preserve any previous state */ | ||
387 | print_histogram = 64 + port->nr; | 381 | print_histogram = 64 + port->nr; |
388 | } | 382 | } |
389 | } | 383 | } |
@@ -766,7 +760,6 @@ static int get_resources(struct saa7164_dev *dev) | |||
766 | static int saa7164_port_init(struct saa7164_dev *dev, int portnr) | 760 | static int saa7164_port_init(struct saa7164_dev *dev, int portnr) |
767 | { | 761 | { |
768 | struct saa7164_port *port = 0; | 762 | struct saa7164_port *port = 0; |
769 | int i; | ||
770 | 763 | ||
771 | if ((portnr < 0) || (portnr >= SAA7164_MAX_PORTS)) | 764 | if ((portnr < 0) || (portnr >= SAA7164_MAX_PORTS)) |
772 | BUG(); | 765 | BUG(); |
@@ -805,18 +798,6 @@ static int saa7164_port_init(struct saa7164_dev *dev, int portnr) | |||
805 | saa7164_histogram_reset(&port->poll_interval, | 798 | saa7164_histogram_reset(&port->poll_interval, |
806 | "encoder poll() intervals"); | 799 | "encoder poll() intervals"); |
807 | 800 | ||
808 | if (port->type == SAA7164_MPEG_ENCODER) { | ||
809 | for (i = 0; i < 8; i ++) { | ||
810 | port->shadow_buf[i] = kzalloc(256 * 128, GFP_KERNEL); | ||
811 | if (port->shadow_buf[i] == 0) | ||
812 | printk(KERN_ERR "%s() shadow_buf ENOMEM\n", __func__); | ||
813 | else { | ||
814 | memset(port->shadow_buf[i], 0xff, 256 * 128); | ||
815 | port->shadow_crc[i] = crc32(0, port->shadow_buf[i], 256 * 128); | ||
816 | } | ||
817 | } | ||
818 | } | ||
819 | |||
820 | return 0; | 801 | return 0; |
821 | } | 802 | } |
822 | 803 | ||
@@ -1094,8 +1075,6 @@ static void saa7164_shutdown(struct saa7164_dev *dev) | |||
1094 | static void __devexit saa7164_finidev(struct pci_dev *pci_dev) | 1075 | static void __devexit saa7164_finidev(struct pci_dev *pci_dev) |
1095 | { | 1076 | { |
1096 | struct saa7164_dev *dev = pci_get_drvdata(pci_dev); | 1077 | struct saa7164_dev *dev = pci_get_drvdata(pci_dev); |
1097 | struct saa7164_port *port; | ||
1098 | int i; | ||
1099 | 1078 | ||
1100 | saa7164_histogram_print(&dev->ports[ SAA7164_PORT_ENC1 ], | 1079 | saa7164_histogram_print(&dev->ports[ SAA7164_PORT_ENC1 ], |
1101 | &dev->ports[ SAA7164_PORT_ENC1 ].irq_interval); | 1080 | &dev->ports[ SAA7164_PORT_ENC1 ].irq_interval); |
@@ -1110,22 +1089,6 @@ static void __devexit saa7164_finidev(struct pci_dev *pci_dev) | |||
1110 | 1089 | ||
1111 | saa7164_shutdown(dev); | 1090 | saa7164_shutdown(dev); |
1112 | 1091 | ||
1113 | port = &dev->ports[ SAA7164_PORT_ENC1 ]; | ||
1114 | if (port->type == SAA7164_MPEG_ENCODER) { | ||
1115 | for (i = 0; i < 8; i ++) { | ||
1116 | kfree(port->shadow_buf[i]); | ||
1117 | port->shadow_buf[i] = 0; | ||
1118 | } | ||
1119 | } | ||
1120 | port = &dev->ports[ SAA7164_PORT_ENC2 ]; | ||
1121 | if (port->type == SAA7164_MPEG_ENCODER) { | ||
1122 | for (i = 0; i < 8; i ++) { | ||
1123 | kfree(port->shadow_buf[i]); | ||
1124 | port->shadow_buf[i] = 0; | ||
1125 | } | ||
1126 | } | ||
1127 | |||
1128 | |||
1129 | if (saa7164_boards[dev->board].porta == SAA7164_MPEG_DVB) | 1092 | if (saa7164_boards[dev->board].porta == SAA7164_MPEG_DVB) |
1130 | saa7164_dvb_unregister(&dev->ports[ SAA7164_PORT_TS1 ]); | 1093 | saa7164_dvb_unregister(&dev->ports[ SAA7164_PORT_TS1 ]); |
1131 | 1094 | ||
diff --git a/drivers/media/video/saa7164/saa7164-encoder.c b/drivers/media/video/saa7164/saa7164-encoder.c index b904c61f8f81..08b62e41c466 100644 --- a/drivers/media/video/saa7164/saa7164-encoder.c +++ b/drivers/media/video/saa7164/saa7164-encoder.c | |||
@@ -1008,7 +1008,6 @@ struct saa7164_user_buffer *saa7164_enc_next_buf(struct saa7164_port *port) | |||
1008 | struct saa7164_user_buffer *buf = 0; | 1008 | struct saa7164_user_buffer *buf = 0; |
1009 | struct saa7164_dev *dev = port->dev; | 1009 | struct saa7164_dev *dev = port->dev; |
1010 | u32 crc; | 1010 | u32 crc; |
1011 | u32 *d; | ||
1012 | 1011 | ||
1013 | mutex_lock(&port->dmaqueue_lock); | 1012 | mutex_lock(&port->dmaqueue_lock); |
1014 | if (!list_empty(&port->list_buf_used.list)) { | 1013 | if (!list_empty(&port->list_buf_used.list)) { |
@@ -1021,13 +1020,6 @@ struct saa7164_user_buffer *saa7164_enc_next_buf(struct saa7164_port *port) | |||
1021 | buf, buf->crc, crc); | 1020 | buf, buf->crc, crc); |
1022 | } | 1021 | } |
1023 | 1022 | ||
1024 | d = (u32 *)buf->data; | ||
1025 | |||
1026 | if ((*d & 0xffffff) > (port->read_counter + 0x2000)) | ||
1027 | printk(KERN_ERR "%s() *d 0x%x port %p\n", __func__, *d, port); | ||
1028 | |||
1029 | port->read_counter = *d; | ||
1030 | |||
1031 | } | 1023 | } |
1032 | mutex_unlock(&port->dmaqueue_lock); | 1024 | mutex_unlock(&port->dmaqueue_lock); |
1033 | 1025 | ||
diff --git a/drivers/media/video/saa7164/saa7164.h b/drivers/media/video/saa7164/saa7164.h index 9c76e65b9785..71e385328ce3 100644 --- a/drivers/media/video/saa7164/saa7164.h +++ b/drivers/media/video/saa7164/saa7164.h | |||
@@ -378,8 +378,6 @@ struct saa7164_port { | |||
378 | struct saa7164_encoder_params encoder_params; | 378 | struct saa7164_encoder_params encoder_params; |
379 | struct video_device *v4l_device; | 379 | struct video_device *v4l_device; |
380 | atomic_t v4l_reader_count; | 380 | atomic_t v4l_reader_count; |
381 | // spinlock_t slock; | ||
382 | // struct mutex fops_lock; | ||
383 | 381 | ||
384 | struct saa7164_buffer list_buf_used; | 382 | struct saa7164_buffer list_buf_used; |
385 | struct saa7164_buffer list_buf_free; | 383 | struct saa7164_buffer list_buf_free; |
@@ -391,12 +389,6 @@ struct saa7164_port { | |||
391 | u32 a_cc_errors; | 389 | u32 a_cc_errors; |
392 | u8 last_v_cc; | 390 | u8 last_v_cc; |
393 | u8 last_a_cc; | 391 | u8 last_a_cc; |
394 | |||
395 | u8 *shadow_buf[8]; | ||
396 | u32 shadow_crc[8]; | ||
397 | |||
398 | u32 counter; | ||
399 | u32 read_counter; | ||
400 | }; | 392 | }; |
401 | 393 | ||
402 | struct saa7164_dev { | 394 | struct saa7164_dev { |