include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[safe/jmp/linux-2.6] / drivers / media / video / omap24xxcam.c
index 2cea7fe..b189fe6 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/platform_device.h>
 #include <linux/clk.h>
 #include <linux/io.h>
+#include <linux/slab.h>
 
 #include <media/v4l2-common.h>
 #include <media/v4l2-ioctl.h>
@@ -1285,9 +1286,6 @@ static int vidioc_g_parm(struct file *file, void *fh,
        struct omap24xxcam_device *cam = ofh->cam;
        int rval;
 
-       if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
-               return -EINVAL;
-
        mutex_lock(&cam->mutex);
        rval = vidioc_int_g_parm(cam->sdev, a);
        mutex_unlock(&cam->mutex);
@@ -1303,9 +1301,6 @@ static int vidioc_s_parm(struct file *file, void *fh,
        struct v4l2_streamparm old_streamparm;
        int rval;
 
-       if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
-               return -EINVAL;
-
        mutex_lock(&cam->mutex);
        if (cam->streaming) {
                rval = -EBUSY;
@@ -1456,12 +1451,11 @@ static int omap24xxcam_mmap(struct file *file, struct vm_area_struct *vma)
 
 static int omap24xxcam_open(struct file *file)
 {
-       int minor = video_devdata(file)->minor;
        struct omap24xxcam_device *cam = omap24xxcam.priv;
        struct omap24xxcam_fh *fh;
        struct v4l2_format format;
 
-       if (!cam || !cam->vfd || (cam->vfd->minor != minor))
+       if (!cam || !cam->vfd)
                return -ENODEV;
 
        fh = kzalloc(sizeof(*fh), GFP_KERNEL);
@@ -1666,7 +1660,6 @@ static int omap24xxcam_device_register(struct v4l2_int_device *s)
 
        strlcpy(vfd->name, CAM_NAME, sizeof(vfd->name));
        vfd->fops                = &omap24xxcam_fops;
-       vfd->minor               = -1;
        vfd->ioctl_ops           = &omap24xxcam_ioctl_fops;
 
        omap24xxcam_hwinit(cam);
@@ -1677,14 +1670,14 @@ static int omap24xxcam_device_register(struct v4l2_int_device *s)
 
        if (video_register_device(vfd, VFL_TYPE_GRABBER, video_nr) < 0) {
                dev_err(cam->dev, "could not register V4L device\n");
-               vfd->minor = -1;
                rval = -EBUSY;
                goto err;
        }
 
        omap24xxcam_poweron_reset(cam);
 
-       dev_info(cam->dev, "registered device video%d\n", vfd->minor);
+       dev_info(cam->dev, "registered device %s\n",
+                video_device_node_name(vfd));
 
        return 0;
 
@@ -1701,7 +1694,7 @@ static void omap24xxcam_device_unregister(struct v4l2_int_device *s)
        omap24xxcam_sensor_exit(cam);
 
        if (cam->vfd) {
-               if (cam->vfd->minor == -1) {
+               if (!video_is_registered(cam->vfd)) {
                        /*
                         * The device was never registered, so release the
                         * video_device struct directly.
@@ -1743,7 +1736,7 @@ static struct v4l2_int_device omap24xxcam = {
  *
  */
 
-static int __init omap24xxcam_probe(struct platform_device *pdev)
+static int __devinit omap24xxcam_probe(struct platform_device *pdev)
 {
        struct omap24xxcam_device *cam;
        struct resource *mem;