]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/common/saa7146_video.c
Merge branch 'pxa-trizeps' into pxa-machines
[linux-2.6-omap-h63xx.git] / drivers / media / common / saa7146_video.c
index a5e62750eea3cb59b976aec917e6b88ab2a1ed87..99be9e5c85f78c5221a4107ff06233e70a36e242 100644 (file)
@@ -656,7 +656,7 @@ static int saa7146_pgtable_build(struct saa7146_dev *dev, struct saa7146_buf *bu
 
                /* if we have a user buffer, the first page may not be
                   aligned to a page boundary. */
-               pt1->offset = list->offset;
+               pt1->offset = dma->sglist->offset;
                pt2->offset = pt1->offset+o1;
                pt3->offset = pt1->offset+o2;
 
@@ -958,21 +958,18 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
        case VIDIOC_ENUM_FMT:
        {
                struct v4l2_fmtdesc *f = arg;
-               int index;
 
                switch (f->type) {
                case V4L2_BUF_TYPE_VIDEO_CAPTURE:
-               case V4L2_BUF_TYPE_VIDEO_OVERLAY: {
-                       index = f->index;
-                       if (index < 0 || index >= NUM_FORMATS) {
+               case V4L2_BUF_TYPE_VIDEO_OVERLAY:
+                       if (f->index >= NUM_FORMATS)
                                return -EINVAL;
-                       }
-                       memset(f,0,sizeof(*f));
-                       f->index = index;
-                       strlcpy((char *)f->description,formats[index].name,sizeof(f->description));
-                       f->pixelformat = formats[index].pixelformat;
+                       strlcpy((char *)f->description, formats[f->index].name,
+                                       sizeof(f->description));
+                       f->pixelformat = formats[f->index].pixelformat;
+                       f->flags = 0;
+                       memset(f->reserved, 0, sizeof(f->reserved));
                        break;
-               }
                default:
                        return -EINVAL;
                }
@@ -1071,7 +1068,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
        {
                v4l2_std_id *id = arg;
                int found = 0;
-               int i, err;
+               int i;
 
                DEB_EE(("VIDIOC_S_STD\n"));
 
@@ -1119,7 +1116,6 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
        case VIDIOC_OVERLAY:
        {
                int on = *(int *)arg;
-               int err = 0;
 
                DEB_D(("VIDIOC_OVERLAY on:%d\n",on));
                if (on != 0) {
@@ -1195,7 +1191,6 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
        case VIDIOCGMBUF:
        {
                struct video_mbuf *mbuf = arg;
-               struct videobuf_queue *q;
                int i;
 
                /* fixme: number of capture buffers and sizes for v4l apps */