| Linux kernel & device driver programming |
| [ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] |
1 /* 1
2 comedi/drivers/comedi_pci.h
3 Various PCI functions for drivers.
4
5 Copyright (C) 2007 MEV Ltd. <http://www.me
6
7 COMEDI - Linux Control and Measurement Dev
8 Copyright (C) 2000 David A. Schleef <ds@sc
9
10 This program is free software; you can red
11 it under the terms of the GNU General Publ
12 the Free Software Foundation; either versi
13 (at your option) any later version.
14
15 This program is distributed in the hope th
16 but WITHOUT ANY WARRANTY; without even the
17 MERCHANTABILITY or FITNESS FOR A PARTICULA
18 GNU General Public License for more detail
19
20 You should have received a copy of the GNU
21 along with this program; if not, write to
22 Foundation, Inc., 675 Mass Ave, Cambridge,
23
24 */
25
26 #ifndef _COMEDI_PCI_H_
27 #define _COMEDI_PCI_H_
28
29 #include <linux/pci.h>
30
31 /*
32 * Enable the PCI device and request the regio
33 */
34 static inline int comedi_pci_enable(struct pci
35 {
36 int rc;
37
38 rc = pci_enable_device(pdev);
39 if (rc < 0)
40 return rc;
41
42 rc = pci_request_regions(pdev, res_nam
43 if (rc < 0)
44 pci_disable_device(pdev);
45
46 return rc;
47 }
48
49 /*
50 * Release the regions and disable the PCI dev
51 *
52 * This must be matched with a previous succes
53 */
54 static inline void comedi_pci_disable(struct p
55 {
56 pci_release_regions(pdev);
57 pci_disable_device(pdev);
58 }
59
60 #endif
61
| This page was automatically generated by the LXR engine. |