Used comedi_pci_enable() and comedi_pci_disable().
authorIan Abbott <abbotti@mev.co.uk>
Tue, 25 Mar 2008 12:42:38 +0000 (12:42 +0000)
committerIan Abbott <abbotti@mev.co.uk>
Tue, 25 Mar 2008 12:42:38 +0000 (12:42 +0000)
comedi/drivers/adv_pci1723.c

index 47d19cf36d14d94c89d2fc5103394758d5b9474a..cb437d0a5c71bd1bc7e302a869368525cc01daa8 100644 (file)
@@ -45,7 +45,7 @@ TODO:
 
 #include <linux/comedidev.h>
 
-#include <linux/pci.h>         /* for PCI devices */
+#include "comedi_pci.h"
 
 #define ADVANTECH_VENDOR        0x13fe /* Advantech PCI vendor ID */
 
@@ -330,12 +330,8 @@ static int pci1723_attach(comedi_device * dev, comedi_devconfig * it)
                 * Look for device that isn't in use.
                 * Enable PCI device and request regions.
                 */
-               if (pci_enable_device(pcidev)) {
-                       errstr = "failed to enable PCI device!";
-                       continue;
-               }
-               if (pci_request_regions(pcidev, "adl_pci1723")) {
-                       errstr = "in use or I/O port conflict!";
+               if (comedi_pci_enable(pcidev, "adv_pci1723")) {
+                       errstr = "failed to enable PCI device and request regions!";
                        continue;
                }
                break;
@@ -451,8 +447,7 @@ static int pci1723_detach(comedi_device * dev)
 
                if (devpriv->pcidev) {
                        if (dev->iobase) {
-                               pci_release_regions(devpriv->pcidev);
-                               pci_disable_device(devpriv->pcidev);
+                               comedi_pci_disable(devpriv->pcidev);
                        }
                        pci_dev_put(devpriv->pcidev);
                }