summaryrefslogtreecommitdiff
path: root/linux/drivers/media/common
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2006-03-16 20:37:51 -0500
committerMichael Krufky <mkrufky@linuxtv.org>2006-03-16 20:37:51 -0500
commitd30a31decd05aa55764418cce0b9cce695885439 (patch)
tree8fffef97b8b6d19639ed547eb7d6253b0f336e48 /linux/drivers/media/common
parente0449a4964c2aec77cf02c33d2a9375b647530ce (diff)
parent32027c8007a8b9e82f70f5eb52387db827ff8b2d (diff)
downloadmediapointer-dvb-s2-d30a31decd05aa55764418cce0b9cce695885439.tar.gz
mediapointer-dvb-s2-d30a31decd05aa55764418cce0b9cce695885439.tar.bz2
merged ~mkrufky/pending
From: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Diffstat (limited to 'linux/drivers/media/common')
-rw-r--r--linux/drivers/media/common/saa7146_core.c3
-rw-r--r--linux/drivers/media/common/saa7146_fops.c11
-rw-r--r--linux/drivers/media/common/saa7146_vbi.c8
-rw-r--r--linux/drivers/media/common/saa7146_video.c8
4 files changed, 14 insertions, 16 deletions
diff --git a/linux/drivers/media/common/saa7146_core.c b/linux/drivers/media/common/saa7146_core.c
index 71a5f1329..4233c2c2b 100644
--- a/linux/drivers/media/common/saa7146_core.c
+++ b/linux/drivers/media/common/saa7146_core.c
@@ -116,8 +116,7 @@ static struct scatterlist* vmalloc_to_sg(unsigned char *virt, int nr_pages)
pg = vmalloc_to_page(virt);
if (NULL == pg)
goto err;
- if (PageHighMem(pg))
- BUG();
+ BUG_ON(PageHighMem(pg));
sglist[i].page = pg;
sglist[i].length = PAGE_SIZE;
}
diff --git a/linux/drivers/media/common/saa7146_fops.c b/linux/drivers/media/common/saa7146_fops.c
index 480a34a26..2dde5a240 100644
--- a/linux/drivers/media/common/saa7146_fops.c
+++ b/linux/drivers/media/common/saa7146_fops.c
@@ -38,8 +38,7 @@ void saa7146_res_free(struct saa7146_fh *fh, unsigned int bits)
struct saa7146_dev *dev = fh->dev;
struct saa7146_vv *vv = dev->vv_data;
- if ((fh->resources & bits) != bits)
- BUG();
+ BUG_ON((fh->resources & bits) != bits);
mutex_lock(&dev->lock);
fh->resources &= ~bits;
@@ -52,15 +51,15 @@ void saa7146_res_free(struct saa7146_fh *fh, unsigned int bits)
/********************************************************************************/
/* common dma functions */
-void saa7146_dma_free(struct saa7146_dev *dev,struct saa7146_buf *buf)
+void saa7146_dma_free(struct saa7146_dev *dev,struct videobuf_queue *q,
+ struct saa7146_buf *buf)
{
DEB_EE(("dev:%p, buf:%p\n",dev,buf));
- if (in_interrupt())
- BUG();
+ BUG_ON(in_interrupt());
videobuf_waiton(&buf->vb,0,0);
- videobuf_dma_pci_unmap(dev->pci, &buf->vb.dma);
+ videobuf_dma_unmap(q, &buf->vb.dma);
videobuf_dma_free(&buf->vb.dma);
buf->vb.state = STATE_NEEDS_INIT;
}
diff --git a/linux/drivers/media/common/saa7146_vbi.c b/linux/drivers/media/common/saa7146_vbi.c
index 3d403a760..510594fbd 100644
--- a/linux/drivers/media/common/saa7146_vbi.c
+++ b/linux/drivers/media/common/saa7146_vbi.c
@@ -237,7 +237,7 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,e
}
if (buf->vb.size != size)
- saa7146_dma_free(dev,buf);
+ saa7146_dma_free(dev,q,buf);
if (STATE_NEEDS_INIT == buf->vb.state) {
buf->vb.width = llength;
@@ -248,7 +248,7 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,e
saa7146_pgtable_free(dev->pci, &buf->pt[2]);
saa7146_pgtable_alloc(dev->pci, &buf->pt[2]);
- err = videobuf_iolock(dev->pci,&buf->vb, NULL);
+ err = videobuf_iolock(q,&buf->vb, NULL);
if (err)
goto oops;
err = saa7146_pgtable_build_single(dev->pci, &buf->pt[2], buf->vb.dma.sglist, buf->vb.dma.sglen);
@@ -262,7 +262,7 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,e
oops:
DEB_VBI(("error out.\n"));
- saa7146_dma_free(dev,buf);
+ saa7146_dma_free(dev,q,buf);
return err;
}
@@ -302,7 +302,7 @@ static void buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb)
struct saa7146_buf *buf = (struct saa7146_buf *)vb;
DEB_VBI(("vb:%p\n",vb));
- saa7146_dma_free(dev,buf);
+ saa7146_dma_free(dev,q,buf);
}
static struct videobuf_queue_ops vbi_qops = {
diff --git a/linux/drivers/media/common/saa7146_video.c b/linux/drivers/media/common/saa7146_video.c
index 4f1ccaee7..e24edb892 100644
--- a/linux/drivers/media/common/saa7146_video.c
+++ b/linux/drivers/media/common/saa7146_video.c
@@ -1276,7 +1276,7 @@ static int buffer_prepare(struct videobuf_queue *q,
buf->vb.field != field ||
buf->vb.field != fh->video_fmt.field ||
buf->fmt != &fh->video_fmt) {
- saa7146_dma_free(dev,buf);
+ saa7146_dma_free(dev,q,buf);
}
if (STATE_NEEDS_INIT == buf->vb.state) {
@@ -1305,7 +1305,7 @@ static int buffer_prepare(struct videobuf_queue *q,
saa7146_pgtable_alloc(dev->pci, &buf->pt[0]);
}
- err = videobuf_iolock(dev->pci,&buf->vb, &vv->ov_fb);
+ err = videobuf_iolock(q,&buf->vb, &vv->ov_fb);
if (err)
goto oops;
err = saa7146_pgtable_build(dev,buf);
@@ -1319,7 +1319,7 @@ static int buffer_prepare(struct videobuf_queue *q,
oops:
DEB_D(("error out.\n"));
- saa7146_dma_free(dev,buf);
+ saa7146_dma_free(dev,q,buf);
return err;
}
@@ -1364,7 +1364,7 @@ static void buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb)
struct saa7146_buf *buf = (struct saa7146_buf *)vb;
DEB_CAP(("vbuf:%p\n",vb));
- saa7146_dma_free(dev,buf);
+ saa7146_dma_free(dev,q,buf);
}
static struct videobuf_queue_ops video_qops = {