]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
staging: comedi: don't check driver->auto_attach
authorIan Abbott <abbotti@mev.co.uk>
Wed, 14 Nov 2012 13:10:37 +0000 (13:10 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Nov 2012 00:25:47 +0000 (16:25 -0800)
There is no need for `comedi_pci_auto_config()` and
`comedi_usb_auto_config()` to check that `driver->auto_attach` is
non-null before calling `comedi_auto_attach()` as this check is done by
`comedi_auto_config()` itself (actually by
`comedi_auto_config_wrapper()`).  Remove the unnecessary checks.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers.c

index 047c1d911c8dfbabc0251dfa4cbec10a3d0cfd44..d27425eb97716822e876957dbcd46527437a0049 100644 (file)
@@ -949,11 +949,7 @@ EXPORT_SYMBOL_GPL(comedi_pci_disable);
 
 int comedi_pci_auto_config(struct pci_dev *pcidev, struct comedi_driver *driver)
 {
-
-       if (driver->auto_attach)
-               return comedi_auto_config(&pcidev->dev, driver, 0);
-       else
-               return -EINVAL;
+       return comedi_auto_config(&pcidev->dev, driver, 0);
 }
 EXPORT_SYMBOL_GPL(comedi_pci_auto_config);
 
@@ -1000,10 +996,7 @@ int comedi_usb_auto_config(struct usb_interface *intf,
                           struct comedi_driver *driver)
 {
        BUG_ON(intf == NULL);
-       if (driver->auto_attach)
-               return comedi_auto_config(&intf->dev, driver, 0);
-       else
-               return -EINVAL;
+       return comedi_auto_config(&intf->dev, driver, 0);
 }
 EXPORT_SYMBOL_GPL(comedi_usb_auto_config);