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, ...@@ -493,7 +493,7 @@ static int usb_dsbr100_probe(struct usb_interface *intf,
radio->usbdev = interface_to_usbdev(intf); radio->usbdev = interface_to_usbdev(intf);
radio->curfreq = FREQ_MIN*FREQ_MUL; radio->curfreq = FREQ_MIN*FREQ_MUL;
video_set_drvdata(radio->videodev, radio); 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"); warn("Could not register video device");
video_device_release(radio->videodev); video_device_release(radio->videodev);
kfree(radio->transfer_buffer); kfree(radio->transfer_buffer);
......
...@@ -426,8 +426,7 @@ static int __init rtrack_init(void) ...@@ -426,8 +426,7 @@ static int __init rtrack_init(void)
rtrack_radio.priv=&rtrack_unit; 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); release_region(io, 2);
return -EINVAL; return -EINVAL;
} }
......
...@@ -394,8 +394,7 @@ static int __init aztech_init(void) ...@@ -394,8 +394,7 @@ static int __init aztech_init(void)
mutex_init(&lock); mutex_init(&lock);
aztech_radio.priv=&aztech_unit; 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); release_region(io,2);
return -EINVAL; return -EINVAL;
} }
......
...@@ -682,7 +682,7 @@ static int __init cadet_init(void) ...@@ -682,7 +682,7 @@ static int __init cadet_init(void)
} }
if (!request_region(io,2,"cadet")) if (!request_region(io,2,"cadet"))
goto fail; 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); release_region(io,2);
goto fail; goto fail;
} }
......
...@@ -425,7 +425,7 @@ static int __devinit gemtek_pci_probe( struct pci_dev *pci_dev, const struct pci ...@@ -425,7 +425,7 @@ static int __devinit gemtek_pci_probe( struct pci_dev *pci_dev, const struct pci
} }
*devradio = vdev_template; *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 ); kfree( devradio );
goto err_video; goto err_video;
} }
......
...@@ -612,8 +612,7 @@ static int __init gemtek_init(void) ...@@ -612,8 +612,7 @@ static int __init gemtek_init(void)
gemtek_radio.priv = &gemtek_unit; gemtek_radio.priv = &gemtek_unit;
if (video_register_device(&gemtek_radio, VFL_TYPE_RADIO, if (video_register_device(&gemtek_radio, VFL_TYPE_RADIO, radio_nr) < 0) {
radio_nr) == -1) {
release_region(io, 1); release_region(io, 1);
return -EBUSY; return -EBUSY;
} }
......
...@@ -409,8 +409,7 @@ static int __devinit maestro_probe(struct pci_dev *pdev, ...@@ -409,8 +409,7 @@ static int __devinit maestro_probe(struct pci_dev *pdev,
video_set_drvdata(maestro_radio_inst, radio_unit); video_set_drvdata(maestro_radio_inst, radio_unit);
pci_set_drvdata(pdev, maestro_radio_inst); pci_set_drvdata(pdev, maestro_radio_inst);
retval = video_register_device(maestro_radio_inst, VFL_TYPE_RADIO, retval = video_register_device(maestro_radio_inst, VFL_TYPE_RADIO, radio_nr);
radio_nr);
if (retval) { if (retval) {
printk(KERN_ERR "can't register video device!\n"); printk(KERN_ERR "can't register video device!\n");
goto errfr1; goto errfr1;
......
...@@ -410,7 +410,7 @@ static int __devinit maxiradio_init_one(struct pci_dev *pdev, const struct pci_d ...@@ -410,7 +410,7 @@ static int __devinit maxiradio_init_one(struct pci_dev *pdev, const struct pci_d
mutex_init(&radio_unit.lock); mutex_init(&radio_unit.lock);
maxiradio_radio.priv = &radio_unit; 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!"); printk("radio-maxiradio: can't register device!");
goto err_out_free_region; goto err_out_free_region;
} }
......
...@@ -332,8 +332,7 @@ static int __init rtrack2_init(void) ...@@ -332,8 +332,7 @@ static int __init rtrack2_init(void)
rtrack2_radio.priv=&rtrack2_unit; rtrack2_radio.priv=&rtrack2_unit;
spin_lock_init(&lock); 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); release_region(io, 4);
return -EINVAL; return -EINVAL;
} }
......
...@@ -377,7 +377,7 @@ static int __init fmi_init(void) ...@@ -377,7 +377,7 @@ static int __init fmi_init(void)
mutex_init(&lock); 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); release_region(io, 2);
return -EINVAL; return -EINVAL;
} }
......
...@@ -1694,8 +1694,8 @@ static int si470x_usb_driver_probe(struct usb_interface *intf, ...@@ -1694,8 +1694,8 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
INIT_DELAYED_WORK(&radio->work, si470x_work); INIT_DELAYED_WORK(&radio->work, si470x_work);
/* register video device */ /* register video device */
if (video_register_device(radio->videodev, VFL_TYPE_RADIO, radio_nr)) { retval = video_register_device(radio->videodev, VFL_TYPE_RADIO, radio_nr);
retval = -EIO; if (retval) {
printk(KERN_WARNING DRIVER_NAME printk(KERN_WARNING DRIVER_NAME
": Could not register video device\n"); ": Could not register video device\n");
goto err_all; goto err_all;
......
...@@ -405,8 +405,7 @@ static int __init terratec_init(void) ...@@ -405,8 +405,7 @@ static int __init terratec_init(void)
spin_lock_init(&lock); 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); release_region(io,2);
return -EINVAL; return -EINVAL;
} }
......
...@@ -378,8 +378,7 @@ static int __init trust_init(void) ...@@ -378,8 +378,7 @@ static int __init trust_init(void)
printk(KERN_ERR "trust: port 0x%x already in use\n", io); printk(KERN_ERR "trust: port 0x%x already in use\n", io);
return -EBUSY; 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); release_region(io, 2);
return -EINVAL; return -EINVAL;
} }
......
...@@ -446,8 +446,7 @@ static int __init zoltrix_init(void) ...@@ -446,8 +446,7 @@ static int __init zoltrix_init(void)
return -EBUSY; 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); release_region(io, 2);
return -EINVAL; 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