]> err.no Git - linux-2.6/blobdiff - drivers/media/video/bt8xx/bttv-driver.c
Merge branch 'bkl-removal' into next
[linux-2.6] / drivers / media / video / bt8xx / bttv-driver.c
index af2c0c994186bdbf8bb2aca16174b8ea5f7c6ef9..0165aac533bf1d98eb7d7c9f2a0c4cf71f61d11e 100644 (file)
@@ -2613,7 +2613,7 @@ static int vidiocgmbuf(struct file *file, void *priv, struct video_mbuf *mbuf)
        struct bttv_fh *fh = priv;
 
        mutex_lock(&fh->cap.vb_lock);
-       retval = videobuf_mmap_setup(&fh->cap, gbuffers, gbufsize,
+       retval = __videobuf_mmap_setup(&fh->cap, gbuffers, gbufsize,
                                     V4L2_MEMORY_MMAP);
        if (retval < 0) {
                mutex_unlock(&fh->cap.vb_lock);
@@ -3117,12 +3117,18 @@ static int bttv_s_crop(struct file *file, void *f, struct v4l2_crop *crop)
 
 static int bttv_g_audio(struct file *file, void *priv, struct v4l2_audio *a)
 {
+       if (unlikely(a->index))
+               return -EINVAL;
+
        strcpy(a->name, "audio");
        return 0;
 }
 
 static int bttv_s_audio(struct file *file, void *priv, struct v4l2_audio *a)
 {
+       if (unlikely(a->index))
+               return -EINVAL;
+
        return 0;
 }
 
@@ -3457,6 +3463,9 @@ static int radio_release(struct inode *inode, struct file *file)
        struct bttv *btv = fh->btv;
        struct rds_command cmd;
 
+       file->private_data = NULL;
+       kfree(fh);
+
        btv->radio_user--;
 
        bttv_call_i2c_clients(btv, RDS_CMD_CLOSE, &cmd);
@@ -3510,7 +3519,7 @@ static int radio_enum_input(struct file *file, void *priv,
                return -EINVAL;
 
        strcpy(i->name, "Radio");
-        i->type = V4L2_INPUT_TYPE_TUNER;
+       i->type = V4L2_INPUT_TYPE_TUNER;
 
        return 0;
 }
@@ -3518,10 +3527,9 @@ static int radio_enum_input(struct file *file, void *priv,
 static int radio_g_audio(struct file *file, void *priv,
                                        struct v4l2_audio *a)
 {
-       if (a->index != 0)
+       if (unlikely(a->index))
                return -EINVAL;
 
-       memset(a, 0, sizeof(*a));
        strcpy(a->name, "Radio");
 
        return 0;
@@ -3543,11 +3551,17 @@ static int radio_s_tuner(struct file *file, void *priv,
 static int radio_s_audio(struct file *file, void *priv,
                                        struct v4l2_audio *a)
 {
+       if (unlikely(a->index))
+               return -EINVAL;
+
        return 0;
 }
 
 static int radio_s_input(struct file *filp, void *priv, unsigned int i)
 {
+       if (unlikely(i))
+               return -EINVAL;
+
        return 0;
 }