]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[media] dvb-bt8xx: Don't return -EFAULT when a device is not found
authorMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 6 Jul 2011 12:05:41 +0000 (09:05 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 7 Jul 2011 16:43:13 +0000 (13:43 -0300)
When a device (or their PCI structs) are not found, the error should
be -ENODEV. -EFAULT is reserved for errors while copying arguments
from/to userspace.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/bt8xx/dvb-bt8xx.c

index 1e1106dcd063ebd687d552bcc493873fcd5c8a8b..521d691049824523f7229335bf0eb267f976376f 100644 (file)
@@ -892,7 +892,7 @@ static int __devinit dvb_bt8xx_probe(struct bttv_sub_device *sub)
        if (!(bttv_pci_dev = bttv_get_pcidev(card->bttv_nr))) {
                printk("dvb_bt8xx: no pci device for card %d\n", card->bttv_nr);
                kfree(card);
-               return -EFAULT;
+               return -ENODEV;
        }
 
        if (!(card->bt = dvb_bt8xx_878_match(card->bttv_nr, bttv_pci_dev))) {
@@ -902,7 +902,7 @@ static int __devinit dvb_bt8xx_probe(struct bttv_sub_device *sub)
                       "installed, try removing it.\n");
 
                kfree(card);
-               return -EFAULT;
+               return -ENODEV;
        }
 
        mutex_init(&card->bt->gpio_lock);