Skip to content

Commit

Permalink
V4L/DVB (8779): v4l: fix more incorrect video_register_device result …
Browse files Browse the repository at this point in the history
…checks

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Sep 3, 2008
1 parent cba99ae commit dc60de3
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 11 deletions.
3 changes: 1 addition & 2 deletions drivers/media/video/bw-qcam.c
Original file line number Diff line number Diff line change
Expand Up @@ -946,8 +946,7 @@ static int init_bwqcam(struct parport *port)

printk(KERN_INFO "Connectix Quickcam on %s\n", qcam->pport->name);

if(video_register_device(&qcam->vdev, VFL_TYPE_GRABBER, video_nr)==-1)
{
if (video_register_device(&qcam->vdev, VFL_TYPE_GRABBER, video_nr) < 0) {
parport_unregister_device(qcam->pdev);
kfree(qcam);
return -ENODEV;
Expand Down
3 changes: 1 addition & 2 deletions drivers/media/video/c-qcam.c
Original file line number Diff line number Diff line change
Expand Up @@ -787,8 +787,7 @@ static int init_cqcam(struct parport *port)

parport_release(qcam->pdev);

if (video_register_device(&qcam->vdev, VFL_TYPE_GRABBER, video_nr)==-1)
{
if (video_register_device(&qcam->vdev, VFL_TYPE_GRABBER, video_nr) < 0) {
printk(KERN_ERR "Unable to register Colour QuickCam on %s\n",
qcam->pport->name);
parport_unregister_device(qcam->pdev);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/cpia.c
Original file line number Diff line number Diff line change
Expand Up @@ -3955,7 +3955,7 @@ struct cam_data *cpia_register_camera(struct cpia_camera_ops *ops, void *lowleve
camera->lowlevel_data = lowlevel;

/* register v4l device */
if (video_register_device(&camera->vdev, VFL_TYPE_GRABBER, video_nr) == -1) {
if (video_register_device(&camera->vdev, VFL_TYPE_GRABBER, video_nr) < 0) {
kfree(camera);
printk(KERN_DEBUG "video_register_device failed\n");
return NULL;
Expand Down
3 changes: 1 addition & 2 deletions drivers/media/video/cpia2/cpia2_v4l.c
Original file line number Diff line number Diff line change
Expand Up @@ -1958,8 +1958,7 @@ int cpia2_register_camera(struct camera_data *cam)
reset_camera_struct_v4l(cam);

/* register v4l device */
if (video_register_device
(cam->vdev, VFL_TYPE_GRABBER, video_nr) == -1) {
if (video_register_device(cam->vdev, VFL_TYPE_GRABBER, video_nr) < 0) {
ERR("video_register_device failed\n");
video_device_release(cam->vdev);
return -ENODEV;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/se401.c
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,7 @@ static int se401_probe(struct usb_interface *intf,
mutex_init(&se401->lock);
wmb();

if (video_register_device(&se401->vdev, VFL_TYPE_GRABBER, video_nr) == -1) {
if (video_register_device(&se401->vdev, VFL_TYPE_GRABBER, video_nr) < 0) {
kfree(se401);
err("video_register_device failed");
return -EIO;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/stv680.c
Original file line number Diff line number Diff line change
Expand Up @@ -1462,7 +1462,7 @@ static int stv680_probe (struct usb_interface *intf, const struct usb_device_id
mutex_init (&stv680->lock);
wmb ();

if (video_register_device (stv680->vdev, VFL_TYPE_GRABBER, video_nr) == -1) {
if (video_register_device(stv680->vdev, VFL_TYPE_GRABBER, video_nr) < 0) {
PDEBUG (0, "STV(e): video_register_device failed");
retval = -EIO;
goto error_vdev;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/usbvideo/vicam.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ vicam_probe( struct usb_interface *intf, const struct usb_device_id *id)
cam->udev = dev;
cam->bulkEndpoint = bulkEndpoint;

if (video_register_device(&cam->vdev, VFL_TYPE_GRABBER, -1) == -1) {
if (video_register_device(&cam->vdev, VFL_TYPE_GRABBER, -1) < 0) {
kfree(cam);
printk(KERN_WARNING "video_register_device failed\n");
return -EIO;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/w9966.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ static int w9966_init(struct w9966_dev* cam, struct parport* port)
memcpy(&cam->vdev, &w9966_template, sizeof(struct video_device));
cam->vdev.priv = cam;

if (video_register_device(&cam->vdev, VFL_TYPE_GRABBER, video_nr) == -1)
if (video_register_device(&cam->vdev, VFL_TYPE_GRABBER, video_nr) < 0)
return -1;

w9966_setState(cam, W9966_STATE_VDEV, W9966_STATE_VDEV);
Expand Down

0 comments on commit dc60de3

Please sign in to comment.