[media] media/pci: convert drivers to use the new vb2_queue dev field
Stop using alloc_ctx and just fill in the device pointer. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Federico Vaga <federico.vaga@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:

کامیت شده توسط
Mauro Carvalho Chehab

والد
0e2f511894
کامیت
2bc46b3ad3
@@ -647,7 +647,6 @@ static int queue_setup(struct vb2_queue *q,
|
||||
dev->ts_packet_size = 188 * 4;
|
||||
dev->ts_packet_count = 32;
|
||||
sizes[0] = dev->ts_packet_size * dev->ts_packet_count;
|
||||
alloc_ctxs[0] = dev->alloc_ctx;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1183,6 +1182,7 @@ static int cx8802_blackbird_probe(struct cx8802_driver *drv)
|
||||
q->mem_ops = &vb2_dma_sg_memops;
|
||||
q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
|
||||
q->lock = &core->lock;
|
||||
q->dev = &dev->pci->dev;
|
||||
|
||||
err = vb2_queue_init(q);
|
||||
if (err < 0)
|
||||
|
@@ -92,7 +92,6 @@ static int queue_setup(struct vb2_queue *q,
|
||||
dev->ts_packet_size = 188 * 4;
|
||||
dev->ts_packet_count = dvb_buf_tscnt;
|
||||
sizes[0] = dev->ts_packet_size * dev->ts_packet_count;
|
||||
alloc_ctxs[0] = dev->alloc_ctx;
|
||||
*num_buffers = dvb_buf_tscnt;
|
||||
return 0;
|
||||
}
|
||||
@@ -1793,6 +1792,7 @@ static int cx8802_dvb_probe(struct cx8802_driver *drv)
|
||||
q->mem_ops = &vb2_dma_sg_memops;
|
||||
q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
|
||||
q->lock = &core->lock;
|
||||
q->dev = &dev->pci->dev;
|
||||
|
||||
err = vb2_queue_init(q);
|
||||
if (err < 0)
|
||||
|
@@ -726,11 +726,6 @@ static int cx8802_probe(struct pci_dev *pci_dev,
|
||||
if (NULL == dev)
|
||||
goto fail_core;
|
||||
dev->pci = pci_dev;
|
||||
dev->alloc_ctx = vb2_dma_sg_init_ctx(&pci_dev->dev);
|
||||
if (IS_ERR(dev->alloc_ctx)) {
|
||||
err = PTR_ERR(dev->alloc_ctx);
|
||||
goto fail_dev;
|
||||
}
|
||||
dev->core = core;
|
||||
|
||||
/* Maintain a reference so cx88-video can query the 8802 device. */
|
||||
@@ -738,7 +733,7 @@ static int cx8802_probe(struct pci_dev *pci_dev,
|
||||
|
||||
err = cx8802_init_common(dev);
|
||||
if (err != 0)
|
||||
goto fail_free;
|
||||
goto fail_dev;
|
||||
|
||||
INIT_LIST_HEAD(&dev->drvlist);
|
||||
mutex_lock(&cx8802_mutex);
|
||||
@@ -749,8 +744,6 @@ static int cx8802_probe(struct pci_dev *pci_dev,
|
||||
request_modules(dev);
|
||||
return 0;
|
||||
|
||||
fail_free:
|
||||
vb2_dma_sg_cleanup_ctx(dev->alloc_ctx);
|
||||
fail_dev:
|
||||
kfree(dev);
|
||||
fail_core:
|
||||
@@ -798,7 +791,6 @@ static void cx8802_remove(struct pci_dev *pci_dev)
|
||||
/* common */
|
||||
cx8802_fini_common(dev);
|
||||
cx88_core_put(dev->core,dev->pci);
|
||||
vb2_dma_sg_cleanup_ctx(dev->alloc_ctx);
|
||||
kfree(dev);
|
||||
}
|
||||
|
||||
|
@@ -118,7 +118,6 @@ static int queue_setup(struct vb2_queue *q,
|
||||
sizes[0] = VBI_LINE_NTSC_COUNT * VBI_LINE_LENGTH * 2;
|
||||
else
|
||||
sizes[0] = VBI_LINE_PAL_COUNT * VBI_LINE_LENGTH * 2;
|
||||
alloc_ctxs[0] = dev->alloc_ctx;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -438,7 +438,6 @@ static int queue_setup(struct vb2_queue *q,
|
||||
|
||||
*num_planes = 1;
|
||||
sizes[0] = (dev->fmt->depth * core->width * core->height) >> 3;
|
||||
alloc_ctxs[0] = dev->alloc_ctx;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1319,12 +1318,6 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
|
||||
printk("%s/0: Oops: no 32bit PCI DMA ???\n",core->name);
|
||||
goto fail_core;
|
||||
}
|
||||
dev->alloc_ctx = vb2_dma_sg_init_ctx(&pci_dev->dev);
|
||||
if (IS_ERR(dev->alloc_ctx)) {
|
||||
err = PTR_ERR(dev->alloc_ctx);
|
||||
goto fail_core;
|
||||
}
|
||||
|
||||
|
||||
/* initialize driver struct */
|
||||
spin_lock_init(&dev->slock);
|
||||
@@ -1445,6 +1438,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
|
||||
q->mem_ops = &vb2_dma_sg_memops;
|
||||
q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
|
||||
q->lock = &core->lock;
|
||||
q->dev = &dev->pci->dev;
|
||||
|
||||
err = vb2_queue_init(q);
|
||||
if (err < 0)
|
||||
@@ -1461,6 +1455,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
|
||||
q->mem_ops = &vb2_dma_sg_memops;
|
||||
q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
|
||||
q->lock = &core->lock;
|
||||
q->dev = &dev->pci->dev;
|
||||
|
||||
err = vb2_queue_init(q);
|
||||
if (err < 0)
|
||||
@@ -1530,7 +1525,6 @@ fail_unreg:
|
||||
free_irq(pci_dev->irq, dev);
|
||||
mutex_unlock(&core->lock);
|
||||
fail_core:
|
||||
vb2_dma_sg_cleanup_ctx(dev->alloc_ctx);
|
||||
core->v4ldev = NULL;
|
||||
cx88_core_put(core,dev->pci);
|
||||
fail_free:
|
||||
@@ -1564,7 +1558,6 @@ static void cx8800_finidev(struct pci_dev *pci_dev)
|
||||
|
||||
/* free memory */
|
||||
cx88_core_put(core,dev->pci);
|
||||
vb2_dma_sg_cleanup_ctx(dev->alloc_ctx);
|
||||
kfree(dev);
|
||||
}
|
||||
|
||||
|
@@ -485,7 +485,6 @@ struct cx8800_dev {
|
||||
/* pci i/o */
|
||||
struct pci_dev *pci;
|
||||
unsigned char pci_rev,pci_lat;
|
||||
void *alloc_ctx;
|
||||
|
||||
const struct cx8800_fmt *fmt;
|
||||
|
||||
@@ -549,7 +548,6 @@ struct cx8802_dev {
|
||||
/* pci i/o */
|
||||
struct pci_dev *pci;
|
||||
unsigned char pci_rev,pci_lat;
|
||||
void *alloc_ctx;
|
||||
|
||||
/* dma queues */
|
||||
struct cx88_dmaqueue mpegq;
|
||||
|
مرجع در شماره جدید
Block a user