Commit cba99ae8 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

V4L/DVB (8778): radio: fix incorrect video_register_device result check

Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 6c9de528
......@@ -493,7 +493,7 @@ static int usb_dsbr100_probe(struct usb_interface *intf,
radio->usbdev = interface_to_usbdev(intf);
radio->curfreq = FREQ_MIN*FREQ_MUL;
video_set_drvdata(radio->videodev, radio);
if (video_register_device(radio->videodev, VFL_TYPE_RADIO,radio_nr)) {
if (video_register_device(radio->videodev, VFL_TYPE_RADIO, radio_nr) < 0) {
warn("Could not register video device");
video_device_release(radio->videodev);
kfree(radio->transfer_buffer);
......
......@@ -426,8 +426,7 @@ static int __init rtrack_init(void)
rtrack_radio.priv=&rtrack_unit;
if(video_register_device(&rtrack_radio, VFL_TYPE_RADIO, radio_nr)==-1)
{
if (video_register_device(&rtrack_radio, VFL_TYPE_RADIO, radio_nr) < 0) {
release_region(io, 2);
return -EINVAL;
}
......
......@@ -394,8 +394,7 @@ static int __init aztech_init(void)
mutex_init(&lock);
aztech_radio.priv=&aztech_unit;
if(video_register_device(&aztech_radio, VFL_TYPE_RADIO, radio_nr)==-1)
{
if (video_register_device(&aztech_radio, VFL_TYPE_RADIO, radio_nr) < 0) {
release_region(io,2);
return -EINVAL;
}
......
......@@ -682,7 +682,7 @@ static int __init cadet_init(void)
}
if (!request_region(io,2,"cadet"))
goto fail;
if(video_register_device(&cadet_radio,VFL_TYPE_RADIO,radio_nr)==-1) {
if (video_register_device(&cadet_radio, VFL_TYPE_RADIO, radio_nr) < 0) {
release_region(io,2);
goto fail;
}
......
......@@ -425,7 +425,7 @@ static int __devinit gemtek_pci_probe( struct pci_dev *pci_dev, const struct pci
}
*devradio = vdev_template;
if ( video_register_device( devradio, VFL_TYPE_RADIO , nr_radio) == -1 ) {
if (video_register_device(devradio, VFL_TYPE_RADIO, nr_radio) < 0) {
kfree( devradio );
goto err_video;
}
......
......@@ -612,8 +612,7 @@ static int __init gemtek_init(void)
gemtek_radio.priv = &gemtek_unit;
if (video_register_device(&gemtek_radio, VFL_TYPE_RADIO,
radio_nr) == -1) {
if (video_register_device(&gemtek_radio, VFL_TYPE_RADIO, radio_nr) < 0) {
release_region(io, 1);
return -EBUSY;
}
......
......@@ -409,8 +409,7 @@ static int __devinit maestro_probe(struct pci_dev *pdev,
video_set_drvdata(maestro_radio_inst, radio_unit);
pci_set_drvdata(pdev, maestro_radio_inst);
retval = video_register_device(maestro_radio_inst, VFL_TYPE_RADIO,
radio_nr);
retval = video_register_device(maestro_radio_inst, VFL_TYPE_RADIO, radio_nr);
if (retval) {
printk(KERN_ERR "can't register video device!\n");
goto errfr1;
......
......@@ -410,7 +410,7 @@ static int __devinit maxiradio_init_one(struct pci_dev *pdev, const struct pci_d
mutex_init(&radio_unit.lock);
maxiradio_radio.priv = &radio_unit;
if (video_register_device(&maxiradio_radio, VFL_TYPE_RADIO, radio_nr)==-1) {
if (video_register_device(&maxiradio_radio, VFL_TYPE_RADIO, radio_nr) < 0) {
printk("radio-maxiradio: can't register device!");
goto err_out_free_region;
}
......
......@@ -332,8 +332,7 @@ static int __init rtrack2_init(void)
rtrack2_radio.priv=&rtrack2_unit;
spin_lock_init(&lock);
if(video_register_device(&rtrack2_radio, VFL_TYPE_RADIO, radio_nr)==-1)
{
if (video_register_device(&rtrack2_radio, VFL_TYPE_RADIO, radio_nr) < 0) {
release_region(io, 4);
return -EINVAL;
}
......
......@@ -377,7 +377,7 @@ static int __init fmi_init(void)
mutex_init(&lock);
if (video_register_device(&fmi_radio, VFL_TYPE_RADIO, radio_nr) == -1) {
if (video_register_device(&fmi_radio, VFL_TYPE_RADIO, radio_nr) < 0) {
release_region(io, 2);
return -EINVAL;
}
......
......@@ -1694,8 +1694,8 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
INIT_DELAYED_WORK(&radio->work, si470x_work);
/* register video device */
if (video_register_device(radio->videodev, VFL_TYPE_RADIO, radio_nr)) {
retval = -EIO;
retval = video_register_device(radio->videodev, VFL_TYPE_RADIO, radio_nr);
if (retval) {
printk(KERN_WARNING DRIVER_NAME
": Could not register video device\n");
goto err_all;
......
......@@ -405,8 +405,7 @@ static int __init terratec_init(void)
spin_lock_init(&lock);
if(video_register_device(&terratec_radio, VFL_TYPE_RADIO, radio_nr)==-1)
{
if (video_register_device(&terratec_radio, VFL_TYPE_RADIO, radio_nr) < 0) {
release_region(io,2);
return -EINVAL;
}
......
......@@ -378,8 +378,7 @@ static int __init trust_init(void)
printk(KERN_ERR "trust: port 0x%x already in use\n", io);
return -EBUSY;
}
if(video_register_device(&trust_radio, VFL_TYPE_RADIO, radio_nr)==-1)
{
if (video_register_device(&trust_radio, VFL_TYPE_RADIO, radio_nr) < 0) {
release_region(io, 2);
return -EINVAL;
}
......
......@@ -446,8 +446,7 @@ static int __init zoltrix_init(void)
return -EBUSY;
}
if (video_register_device(&zoltrix_radio, VFL_TYPE_RADIO, radio_nr) == -1)
{
if (video_register_device(&zoltrix_radio, VFL_TYPE_RADIO, radio_nr) < 0) {
release_region(io, 2);
return -EINVAL;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment