aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-09-03 16:11:58 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-09-03 17:37:17 -0400
commitdc60de338f4b2d445a24d4e36bbc994f3badb406 (patch)
treee5e75af437a653d01f1b8786127b02844f8adaab /drivers/media
parentcba99ae81901fe61ac4b0d65c697474af29dc4ea (diff)
V4L/DVB (8779): v4l: fix more incorrect video_register_device result checks
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/bw-qcam.c3
-rw-r--r--drivers/media/video/c-qcam.c3
-rw-r--r--drivers/media/video/cpia.c2
-rw-r--r--drivers/media/video/cpia2/cpia2_v4l.c3
-rw-r--r--drivers/media/video/se401.c2
-rw-r--r--drivers/media/video/stv680.c2
-rw-r--r--drivers/media/video/usbvideo/vicam.c2
-rw-r--r--drivers/media/video/w9966.c2
8 files changed, 8 insertions, 11 deletions
diff --git a/drivers/media/video/bw-qcam.c b/drivers/media/video/bw-qcam.c
index d3b3268bace8..6e39e253ce53 100644
--- a/drivers/media/video/bw-qcam.c
+++ b/drivers/media/video/bw-qcam.c
@@ -946,8 +946,7 @@ static int init_bwqcam(struct parport *port)
946 946
947 printk(KERN_INFO "Connectix Quickcam on %s\n", qcam->pport->name); 947 printk(KERN_INFO "Connectix Quickcam on %s\n", qcam->pport->name);
948 948
949 if(video_register_device(&qcam->vdev, VFL_TYPE_GRABBER, video_nr)==-1) 949 if (video_register_device(&qcam->vdev, VFL_TYPE_GRABBER, video_nr) < 0) {
950 {
951 parport_unregister_device(qcam->pdev); 950 parport_unregister_device(qcam->pdev);
952 kfree(qcam); 951 kfree(qcam);
953 return -ENODEV; 952 return -ENODEV;
diff --git a/drivers/media/video/c-qcam.c b/drivers/media/video/c-qcam.c
index fe9379b282d3..7f6c6b4bec10 100644
--- a/drivers/media/video/c-qcam.c
+++ b/drivers/media/video/c-qcam.c
@@ -787,8 +787,7 @@ static int init_cqcam(struct parport *port)
787 787
788 parport_release(qcam->pdev); 788 parport_release(qcam->pdev);
789 789
790 if (video_register_device(&qcam->vdev, VFL_TYPE_GRABBER, video_nr)==-1) 790 if (video_register_device(&qcam->vdev, VFL_TYPE_GRABBER, video_nr) < 0) {
791 {
792 printk(KERN_ERR "Unable to register Colour QuickCam on %s\n", 791 printk(KERN_ERR "Unable to register Colour QuickCam on %s\n",
793 qcam->pport->name); 792 qcam->pport->name);
794 parport_unregister_device(qcam->pdev); 793 parport_unregister_device(qcam->pdev);
diff --git a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c
index dc8cc6115e2f..a661800b0e69 100644
--- a/drivers/media/video/cpia.c
+++ b/drivers/media/video/cpia.c
@@ -3955,7 +3955,7 @@ struct cam_data *cpia_register_camera(struct cpia_camera_ops *ops, void *lowleve
3955 camera->lowlevel_data = lowlevel; 3955 camera->lowlevel_data = lowlevel;
3956 3956
3957 /* register v4l device */ 3957 /* register v4l device */
3958 if (video_register_device(&camera->vdev, VFL_TYPE_GRABBER, video_nr) == -1) { 3958 if (video_register_device(&camera->vdev, VFL_TYPE_GRABBER, video_nr) < 0) {
3959 kfree(camera); 3959 kfree(camera);
3960 printk(KERN_DEBUG "video_register_device failed\n"); 3960 printk(KERN_DEBUG "video_register_device failed\n");
3961 return NULL; 3961 return NULL;
diff --git a/drivers/media/video/cpia2/cpia2_v4l.c b/drivers/media/video/cpia2/cpia2_v4l.c
index c82570606427..eb9f15cd4c45 100644
--- a/drivers/media/video/cpia2/cpia2_v4l.c
+++ b/drivers/media/video/cpia2/cpia2_v4l.c
@@ -1958,8 +1958,7 @@ int cpia2_register_camera(struct camera_data *cam)
1958 reset_camera_struct_v4l(cam); 1958 reset_camera_struct_v4l(cam);
1959 1959
1960 /* register v4l device */ 1960 /* register v4l device */
1961 if (video_register_device 1961 if (video_register_device(cam->vdev, VFL_TYPE_GRABBER, video_nr) < 0) {
1962 (cam->vdev, VFL_TYPE_GRABBER, video_nr) == -1) {
1963 ERR("video_register_device failed\n"); 1962 ERR("video_register_device failed\n");
1964 video_device_release(cam->vdev); 1963 video_device_release(cam->vdev);
1965 return -ENODEV; 1964 return -ENODEV;
diff --git a/drivers/media/video/se401.c b/drivers/media/video/se401.c
index f481277892da..acceed5d04ae 100644
--- a/drivers/media/video/se401.c
+++ b/drivers/media/video/se401.c
@@ -1397,7 +1397,7 @@ static int se401_probe(struct usb_interface *intf,
1397 mutex_init(&se401->lock); 1397 mutex_init(&se401->lock);
1398 wmb(); 1398 wmb();
1399 1399
1400 if (video_register_device(&se401->vdev, VFL_TYPE_GRABBER, video_nr) == -1) { 1400 if (video_register_device(&se401->vdev, VFL_TYPE_GRABBER, video_nr) < 0) {
1401 kfree(se401); 1401 kfree(se401);
1402 err("video_register_device failed"); 1402 err("video_register_device failed");
1403 return -EIO; 1403 return -EIO;
diff --git a/drivers/media/video/stv680.c b/drivers/media/video/stv680.c
index 56dc3d6b5b29..dce947439459 100644
--- a/drivers/media/video/stv680.c
+++ b/drivers/media/video/stv680.c
@@ -1462,7 +1462,7 @@ static int stv680_probe (struct usb_interface *intf, const struct usb_device_id
1462 mutex_init (&stv680->lock); 1462 mutex_init (&stv680->lock);
1463 wmb (); 1463 wmb ();
1464 1464
1465 if (video_register_device (stv680->vdev, VFL_TYPE_GRABBER, video_nr) == -1) { 1465 if (video_register_device(stv680->vdev, VFL_TYPE_GRABBER, video_nr) < 0) {
1466 PDEBUG (0, "STV(e): video_register_device failed"); 1466 PDEBUG (0, "STV(e): video_register_device failed");
1467 retval = -EIO; 1467 retval = -EIO;
1468 goto error_vdev; 1468 goto error_vdev;
diff --git a/drivers/media/video/usbvideo/vicam.c b/drivers/media/video/usbvideo/vicam.c
index b7792451a299..2eb45829791c 100644
--- a/drivers/media/video/usbvideo/vicam.c
+++ b/drivers/media/video/usbvideo/vicam.c
@@ -866,7 +866,7 @@ vicam_probe( struct usb_interface *intf, const struct usb_device_id *id)
866 cam->udev = dev; 866 cam->udev = dev;
867 cam->bulkEndpoint = bulkEndpoint; 867 cam->bulkEndpoint = bulkEndpoint;
868 868
869 if (video_register_device(&cam->vdev, VFL_TYPE_GRABBER, -1) == -1) { 869 if (video_register_device(&cam->vdev, VFL_TYPE_GRABBER, -1) < 0) {
870 kfree(cam); 870 kfree(cam);
871 printk(KERN_WARNING "video_register_device failed\n"); 871 printk(KERN_WARNING "video_register_device failed\n");
872 return -EIO; 872 return -EIO;
diff --git a/drivers/media/video/w9966.c b/drivers/media/video/w9966.c
index 9402f40095b4..2ff00bc5ad64 100644
--- a/drivers/media/video/w9966.c
+++ b/drivers/media/video/w9966.c
@@ -334,7 +334,7 @@ static int w9966_init(struct w9966_dev* cam, struct parport* port)
334 memcpy(&cam->vdev, &w9966_template, sizeof(struct video_device)); 334 memcpy(&cam->vdev, &w9966_template, sizeof(struct video_device));
335 cam->vdev.priv = cam; 335 cam->vdev.priv = cam;
336 336
337 if (video_register_device(&cam->vdev, VFL_TYPE_GRABBER, video_nr) == -1) 337 if (video_register_device(&cam->vdev, VFL_TYPE_GRABBER, video_nr) < 0)
338 return -1; 338 return -1;
339 339
340 w9966_setState(cam, W9966_STATE_VDEV, W9966_STATE_VDEV); 340 w9966_setState(cam, W9966_STATE_VDEV, W9966_STATE_VDEV);