提交 7c161822 编写于 作者: S Steven Toth 提交者: Mauro Carvalho Chehab

[media] saa7164: code cleanup

Removed some previous debugging code, whitespace cleanup and
spurious comments.
Signed-off-by: NSteven Toth <stoth@kernellabs.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 cfbaf337
...@@ -241,7 +241,6 @@ int saa7164_buffer_cfg_port(struct saa7164_port *port) ...@@ -241,7 +241,6 @@ int saa7164_buffer_cfg_port(struct saa7164_port *port)
dprintk(DBGLVL_BUF, "%s(port=%d)\n", __func__, port->nr); dprintk(DBGLVL_BUF, "%s(port=%d)\n", __func__, port->nr);
port->counter = 0;
saa7164_writel(port->bufcounter, 0); saa7164_writel(port->bufcounter, 0);
saa7164_writel(port->pitch, params->pitch); saa7164_writel(port->pitch, params->pitch);
saa7164_writel(port->bufsize, params->pitch * params->numberoflines); saa7164_writel(port->bufsize, params->pitch * params->numberoflines);
......
...@@ -363,10 +363,6 @@ static void saa7164_work_enchandler(struct work_struct *w) ...@@ -363,10 +363,6 @@ static void saa7164_work_enchandler(struct work_struct *w)
printk(KERN_ERR "%s() illegal rp count %d\n", __func__, rp); printk(KERN_ERR "%s() illegal rp count %d\n", __func__, rp);
break; break;
} }
/* Process a buffer */
if (port->nr == SAA7164_PORT_ENC1)
printk(KERN_ERR "Port enc1 processing buffer %d\n", rp);
saa7164_work_enchandler_helper(port, rp); saa7164_work_enchandler_helper(port, rp);
port->last_svc_rp = rp; port->last_svc_rp = rp;
cnt++; cnt++;
...@@ -375,15 +371,13 @@ static void saa7164_work_enchandler(struct work_struct *w) ...@@ -375,15 +371,13 @@ static void saa7164_work_enchandler(struct work_struct *w)
break; break;
} }
if (port->nr == SAA7164_PORT_ENC1)
printk(KERN_ERR "Enc1 processed %d buffers for port %p\n", cnt, port);
if (print_histogram == port->nr) { if (print_histogram == port->nr) {
saa7164_histogram_print(port, &port->irq_interval); saa7164_histogram_print(port, &port->irq_interval);
saa7164_histogram_print(port, &port->svc_interval); saa7164_histogram_print(port, &port->svc_interval);
saa7164_histogram_print(port, &port->irq_svc_interval); saa7164_histogram_print(port, &port->irq_svc_interval);
saa7164_histogram_print(port, &port->read_interval); saa7164_histogram_print(port, &port->read_interval);
saa7164_histogram_print(port, &port->poll_interval); saa7164_histogram_print(port, &port->poll_interval);
/* TODO: fix this to preserve any previous state */
print_histogram = 64 + port->nr; print_histogram = 64 + port->nr;
} }
} }
...@@ -766,7 +760,6 @@ static int get_resources(struct saa7164_dev *dev) ...@@ -766,7 +760,6 @@ static int get_resources(struct saa7164_dev *dev)
static int saa7164_port_init(struct saa7164_dev *dev, int portnr) static int saa7164_port_init(struct saa7164_dev *dev, int portnr)
{ {
struct saa7164_port *port = 0; struct saa7164_port *port = 0;
int i;
if ((portnr < 0) || (portnr >= SAA7164_MAX_PORTS)) if ((portnr < 0) || (portnr >= SAA7164_MAX_PORTS))
BUG(); BUG();
...@@ -805,18 +798,6 @@ static int saa7164_port_init(struct saa7164_dev *dev, int portnr) ...@@ -805,18 +798,6 @@ static int saa7164_port_init(struct saa7164_dev *dev, int portnr)
saa7164_histogram_reset(&port->poll_interval, saa7164_histogram_reset(&port->poll_interval,
"encoder poll() intervals"); "encoder poll() intervals");
if (port->type == SAA7164_MPEG_ENCODER) {
for (i = 0; i < 8; i ++) {
port->shadow_buf[i] = kzalloc(256 * 128, GFP_KERNEL);
if (port->shadow_buf[i] == 0)
printk(KERN_ERR "%s() shadow_buf ENOMEM\n", __func__);
else {
memset(port->shadow_buf[i], 0xff, 256 * 128);
port->shadow_crc[i] = crc32(0, port->shadow_buf[i], 256 * 128);
}
}
}
return 0; return 0;
} }
...@@ -1094,8 +1075,6 @@ static void saa7164_shutdown(struct saa7164_dev *dev) ...@@ -1094,8 +1075,6 @@ static void saa7164_shutdown(struct saa7164_dev *dev)
static void __devexit saa7164_finidev(struct pci_dev *pci_dev) static void __devexit saa7164_finidev(struct pci_dev *pci_dev)
{ {
struct saa7164_dev *dev = pci_get_drvdata(pci_dev); struct saa7164_dev *dev = pci_get_drvdata(pci_dev);
struct saa7164_port *port;
int i;
saa7164_histogram_print(&dev->ports[ SAA7164_PORT_ENC1 ], saa7164_histogram_print(&dev->ports[ SAA7164_PORT_ENC1 ],
&dev->ports[ SAA7164_PORT_ENC1 ].irq_interval); &dev->ports[ SAA7164_PORT_ENC1 ].irq_interval);
...@@ -1110,22 +1089,6 @@ static void __devexit saa7164_finidev(struct pci_dev *pci_dev) ...@@ -1110,22 +1089,6 @@ static void __devexit saa7164_finidev(struct pci_dev *pci_dev)
saa7164_shutdown(dev); saa7164_shutdown(dev);
port = &dev->ports[ SAA7164_PORT_ENC1 ];
if (port->type == SAA7164_MPEG_ENCODER) {
for (i = 0; i < 8; i ++) {
kfree(port->shadow_buf[i]);
port->shadow_buf[i] = 0;
}
}
port = &dev->ports[ SAA7164_PORT_ENC2 ];
if (port->type == SAA7164_MPEG_ENCODER) {
for (i = 0; i < 8; i ++) {
kfree(port->shadow_buf[i]);
port->shadow_buf[i] = 0;
}
}
if (saa7164_boards[dev->board].porta == SAA7164_MPEG_DVB) if (saa7164_boards[dev->board].porta == SAA7164_MPEG_DVB)
saa7164_dvb_unregister(&dev->ports[ SAA7164_PORT_TS1 ]); saa7164_dvb_unregister(&dev->ports[ SAA7164_PORT_TS1 ]);
......
...@@ -1008,7 +1008,6 @@ struct saa7164_user_buffer *saa7164_enc_next_buf(struct saa7164_port *port) ...@@ -1008,7 +1008,6 @@ struct saa7164_user_buffer *saa7164_enc_next_buf(struct saa7164_port *port)
struct saa7164_user_buffer *buf = 0; struct saa7164_user_buffer *buf = 0;
struct saa7164_dev *dev = port->dev; struct saa7164_dev *dev = port->dev;
u32 crc; u32 crc;
u32 *d;
mutex_lock(&port->dmaqueue_lock); mutex_lock(&port->dmaqueue_lock);
if (!list_empty(&port->list_buf_used.list)) { 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,13 +1020,6 @@ struct saa7164_user_buffer *saa7164_enc_next_buf(struct saa7164_port *port)
buf, buf->crc, crc); buf, buf->crc, crc);
} }
d = (u32 *)buf->data;
if ((*d & 0xffffff) > (port->read_counter + 0x2000))
printk(KERN_ERR "%s() *d 0x%x port %p\n", __func__, *d, port);
port->read_counter = *d;
} }
mutex_unlock(&port->dmaqueue_lock); mutex_unlock(&port->dmaqueue_lock);
......
...@@ -378,8 +378,6 @@ struct saa7164_port { ...@@ -378,8 +378,6 @@ struct saa7164_port {
struct saa7164_encoder_params encoder_params; struct saa7164_encoder_params encoder_params;
struct video_device *v4l_device; struct video_device *v4l_device;
atomic_t v4l_reader_count; atomic_t v4l_reader_count;
// spinlock_t slock;
// struct mutex fops_lock;
struct saa7164_buffer list_buf_used; struct saa7164_buffer list_buf_used;
struct saa7164_buffer list_buf_free; struct saa7164_buffer list_buf_free;
...@@ -391,12 +389,6 @@ struct saa7164_port { ...@@ -391,12 +389,6 @@ struct saa7164_port {
u32 a_cc_errors; u32 a_cc_errors;
u8 last_v_cc; u8 last_v_cc;
u8 last_a_cc; u8 last_a_cc;
u8 *shadow_buf[8];
u32 shadow_crc[8];
u32 counter;
u32 read_counter;
}; };
struct saa7164_dev { struct saa7164_dev {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册