staging: comedi: don't call attach_pci handler
authorIan Abbott <abbotti@mev.co.uk>
Wed, 14 Nov 2012 13:10:35 +0000 (13:10 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Nov 2012 00:25:47 +0000 (16:25 -0800)
All the Comedi drivers that call `comedi_pci_auto_config()` have
replaced the `attach_pci()` handler in their `struct comedi_driver` with
a `auto_attach()` handler, so there is no need to check for the
existence of the `attach_pci()` handler any more.  Remove this check and
the code that calls it.

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

index d8c3cd32f452dbaf4de0a138053f453a9debb99d..f780d38d6da0b533e079186fcee2016736956c5a 100644 (file)
@@ -947,26 +947,10 @@ void comedi_pci_disable(struct pci_dev *pdev)
 }
 EXPORT_SYMBOL_GPL(comedi_pci_disable);
 
-static int comedi_pci_attach_wrapper(struct comedi_device *dev,
-                                    unsigned long context)
-{
-       return dev->driver->attach_pci(dev, (struct pci_dev *)context);
-}
-
-static int comedi_new_pci_auto_config(struct pci_dev *pcidev,
-                                     struct comedi_driver *driver)
-{
-       return comedi_auto_config_helper(&pcidev->dev, driver,
-                                        comedi_pci_attach_wrapper,
-                                        (unsigned long)pcidev);
-}
-
 int comedi_pci_auto_config(struct pci_dev *pcidev, struct comedi_driver *driver)
 {
 
-       if (driver->attach_pci)
-               return comedi_new_pci_auto_config(pcidev, driver);
-       else if (driver->auto_attach)
+       if (driver->auto_attach)
                return comedi_auto_config(&pcidev->dev, driver, 0);
        else
                return -EINVAL;