staging: comedi: remove private header comedi_pci.h
authorH Hartley Sweeten <hartleys@visionengravers.com>
Tue, 22 May 2012 00:12:12 +0000 (17:12 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Jun 2012 03:24:43 +0000 (20:24 -0700)
Remove the private header, comedi_pci.h, by moving the two
helper functions into divers.c and providing the prototypes
in comedidev.h.

This allows the comedi_pci_enable/disable helper functions
to be shared instead of having an inline version in every
comedi pci driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
39 files changed:
drivers/staging/comedi/comedidev.h
drivers/staging/comedi/drivers.c
drivers/staging/comedi/drivers/addi-data/addi_amcc_s5933.h
drivers/staging/comedi/drivers/adl_pci6208.c
drivers/staging/comedi/drivers/adl_pci7230.c
drivers/staging/comedi/drivers/adl_pci7296.c
drivers/staging/comedi/drivers/adl_pci7432.c
drivers/staging/comedi/drivers/adl_pci8164.c
drivers/staging/comedi/drivers/adl_pci9111.c
drivers/staging/comedi/drivers/adl_pci9118.c
drivers/staging/comedi/drivers/adv_pci1710.c
drivers/staging/comedi/drivers/adv_pci1723.c
drivers/staging/comedi/drivers/adv_pci_dio.c
drivers/staging/comedi/drivers/amplc_dio200.c
drivers/staging/comedi/drivers/amplc_pc236.c
drivers/staging/comedi/drivers/amplc_pc263.c
drivers/staging/comedi/drivers/amplc_pci224.c
drivers/staging/comedi/drivers/amplc_pci230.c
drivers/staging/comedi/drivers/cb_pcidas.c
drivers/staging/comedi/drivers/cb_pcidas64.c
drivers/staging/comedi/drivers/cb_pcidda.c
drivers/staging/comedi/drivers/cb_pcidio.c
drivers/staging/comedi/drivers/cb_pcimdas.c
drivers/staging/comedi/drivers/cb_pcimdda.c
drivers/staging/comedi/drivers/comedi_pci.h [deleted file]
drivers/staging/comedi/drivers/contec_pci_dio.c
drivers/staging/comedi/drivers/daqboard2000.c
drivers/staging/comedi/drivers/das08.c
drivers/staging/comedi/drivers/dt3000.c
drivers/staging/comedi/drivers/dyna_pci10xx.c
drivers/staging/comedi/drivers/gsc_hpdi.c
drivers/staging/comedi/drivers/icp_multi.h
drivers/staging/comedi/drivers/jr3_pci.c
drivers/staging/comedi/drivers/ke_counter.c
drivers/staging/comedi/drivers/me4000.c
drivers/staging/comedi/drivers/me_daq.c
drivers/staging/comedi/drivers/mite.c
drivers/staging/comedi/drivers/rtd520.c
drivers/staging/comedi/drivers/s626.c

index 134be93eaa6dc5820d9cb5e06edcd369f3a7c144..9cd2b51171067e5723927229419330df225e1816 100644 (file)
@@ -40,6 +40,7 @@
 #include <linux/uaccess.h>
 #include <linux/io.h>
 #include <linux/timer.h>
+#include <linux/pci.h>
 
 #include "comedi.h"
 
@@ -180,7 +181,6 @@ struct comedi_async {
                        unsigned int x);
 };
 
-struct pci_dev;
 struct usb_interface;
 
 struct comedi_driver {
@@ -310,7 +310,8 @@ int comedi_driver_unregister(struct comedi_driver *);
        module_driver(__comedi_driver, comedi_driver_register, \
                        comedi_driver_unregister)
 
-struct pci_driver;
+int comedi_pci_enable(struct pci_dev *, const char *);
+void comedi_pci_disable(struct pci_dev *);
 
 int comedi_pci_driver_register(struct comedi_driver *, struct pci_driver *);
 void comedi_pci_driver_unregister(struct comedi_driver *, struct pci_driver *);
index 1c3d6386ea36a918d71a1dbed9c3c07cbafaa18a..7289dcb5c32c92ffe4e5f814f913b906622f35c3 100644 (file)
@@ -908,6 +908,40 @@ static void comedi_auto_unconfig(struct device *hardware_device)
        comedi_free_board_minor(minor);
 }
 
+/**
+ * comedi_pci_enable() - Enable the PCI device and request the regions.
+ * @pdev: pci_dev struct
+ * @res_name: name for the requested reqource
+ */
+int comedi_pci_enable(struct pci_dev *pdev, const char *res_name)
+{
+       int rc;
+
+       rc = pci_enable_device(pdev);
+       if (rc < 0)
+               return rc;
+
+       rc = pci_request_regions(pdev, res_name);
+       if (rc < 0)
+               pci_disable_device(pdev);
+
+       return rc;
+}
+EXPORT_SYMBOL_GPL(comedi_pci_enable);
+
+/**
+ * comedi_pci_disable() - Release the regions and disable the PCI device.
+ * @pdev: pci_dev struct
+ *
+ * This must be matched with a previous successful call to comedi_pci_enable().
+ */
+void comedi_pci_disable(struct pci_dev *pdev)
+{
+       pci_release_regions(pdev);
+       pci_disable_device(pdev);
+}
+EXPORT_SYMBOL_GPL(comedi_pci_disable);
+
 static int comedi_old_pci_auto_config(struct pci_dev *pcidev,
                                      struct comedi_driver *driver)
 {
index 35a3ea19359fe7657440e90dfd99fa0a7b091907..d70ac8bb622857b3651fbfd00d56b3e69abe6f66 100644 (file)
@@ -22,8 +22,6 @@
 
 #include "../../comedidev.h"
 
-#include "../comedi_pci.h"
-
 #ifdef PCI_SUPPORT_VER1
 #error     No support for 2.1.55 and older
 #endif
index de8c68af3210066f78c99d0923eaad4203c78bf0..2f48dc72b20e5bf81a1834407eb37c698a0877d1 100644 (file)
@@ -52,7 +52,6 @@ References:
  * options that are used with comedi_config.
  */
 #include "../comedidev.h"
-#include "comedi_pci.h"
 
 /* Board descriptions */
 struct pci6208_board {
index e8053bc825f4f03ef6c50651ec5c47c433ecaa39..e7eb2290106afa5977e473b11e126d127b68e94d 100644 (file)
@@ -36,7 +36,6 @@ Configuration Options:
 
 #include "../comedidev.h"
 #include <linux/kernel.h>
-#include "comedi_pci.h"
 
 #define PCI7230_DI      0x00
 #define PCI7230_DO         0x00
index b4dae3b7598ba03dce2210712f9c6b3913d78243..bf2f7fb86d77d0e4469bf10034e4f966e113bee9 100644 (file)
@@ -37,7 +37,6 @@ Configuration Options:
 #include "../comedidev.h"
 #include <linux/kernel.h>
 
-#include "comedi_pci.h"
 #include "8255.h"
 /* #include "8253.h" */
 
index 9cbfb61a44781b17af127f1b8c14c023057b80a2..2fc1dbbd81e41338faafb9dc488a3d9412d2a0f6 100644 (file)
@@ -36,7 +36,6 @@ Configuration Options:
 
 #include "../comedidev.h"
 #include <linux/kernel.h>
-#include "comedi_pci.h"
 
 #define PCI7432_DI      0x00
 #define PCI7432_DO         0x00
index 409ef13ad0900298c87ee975deced33bf511bcf0..fbc859e6c201016a5043f3848537169aba9c41e3 100644 (file)
@@ -38,7 +38,6 @@ Configuration Options:
 #include <linux/kernel.h>
 #include <linux/delay.h>
 #include "comedi_fc.h"
-#include "comedi_pci.h"
 #include "8253.h"
 
 #define PCI8164_AXIS_X  0x00
index ccfb1a52154e159895d65f7080c4c515471538eb..308cca76cb824ad1122e81d62f786f8a258713e6 100644 (file)
@@ -81,7 +81,6 @@ TODO:
 #include <linux/interrupt.h>
 
 #include "8253.h"
-#include "comedi_pci.h"
 #include "comedi_fc.h"
 
 #define PCI9111_DRIVER_NAME    "adl_pci9111"
index 78645863297ba5393241b58af192afd412c2e6ad..aa4244e5f91831d0b104d50c212e3aa8114b2d82 100644 (file)
@@ -71,7 +71,6 @@ Configuration options:
 
 #include "amcc_s5933.h"
 #include "8253.h"
-#include "comedi_pci.h"
 #include "comedi_fc.h"
 
 #define PCI_VENDOR_ID_AMCC     0x10e8
index de8c98cfe36768ea223c317d15921ad0c3effcfd..db9f0a56f79f919e462fa1f67e00c286577709ed 100644 (file)
@@ -45,8 +45,6 @@ Configuration options:
 
 #include "../comedidev.h"
 
-#include "comedi_pci.h"
-
 #include "8253.h"
 #include "amcc_s5933.h"
 
index 336addcbce3a522f870eff74c90e5ed6fd7d4735..b8768b54e9430f968fb40202f0ad1a850333bcff 100644 (file)
@@ -50,8 +50,6 @@ TODO:
 
 #include "../comedidev.h"
 
-#include "comedi_pci.h"
-
 #define PCI_VENDOR_ID_ADVANTECH                0x13fe  /* Advantech PCI vendor ID */
 
 /* hardware types of the cards */
index 43a32dc12cde336bb8379a1654b5f05054eefa19..df8236c952e77e5d57d95127796888b74fc60640 100644 (file)
@@ -33,7 +33,6 @@ Configuration options:
 
 #include <linux/delay.h>
 
-#include "comedi_pci.h"
 #include "8255.h"
 #include "8253.h"
 
index c9c5d97b3ca2e61cc67d3371ff118a7022140571..f6f6144344b499f1261b88c6f556c8f3f73489bd 100644 (file)
@@ -210,8 +210,6 @@ order they appear in the channel list.
 
 #include "../comedidev.h"
 
-#include "comedi_pci.h"
-
 #include "8255.h"
 #include "8253.h"
 
index 57ba3228b1a9083a439d71ab4cb94b18ae1480f2..6cb06ec1b30da852fbc2da5b0d7d2af20fc36a24 100644 (file)
@@ -56,8 +56,6 @@ unused.
 
 #include "../comedidev.h"
 
-#include "comedi_pci.h"
-
 #include "8255.h"
 #include "plx9052.h"
 
index 974d7450051ee527588d73dcfa539ec9bc50887f..086579f756ff07f70ca83c70acede54d06f29c37 100644 (file)
@@ -46,8 +46,6 @@ The state of the outputs can be read.
 
 #include "../comedidev.h"
 
-#include "comedi_pci.h"
-
 #define PC263_DRIVER_NAME      "amplc_pc263"
 
 #ifdef CONFIG_COMEDI_AMPLC_PC263_ISA_MODULE
index fbf19cae87478dd3a4df902f4e9d984e9e33a89f..0d1f9cc50ef3cefca4346af04567e3988722c1aa 100644 (file)
@@ -108,8 +108,6 @@ Caveats:
 
 #include "../comedidev.h"
 
-#include "comedi_pci.h"
-
 #include "comedi_fc.h"
 #include "8253.h"
 
index d4c80b1281f2a301beca74bbb8be3f4bb314f9d4..b05a684b80ba2a600bb9e21792e6f3db832bc32a 100644 (file)
@@ -193,7 +193,6 @@ for (or detection of) various hardware problems added by Ian Abbott.
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 
-#include "comedi_pci.h"
 #include "8253.h"
 #include "8255.h"
 
index ee9e084bb96cd2ff3520fb9799bb08fb0fc0b85f..7f88d08ee579238f6074c03d1b2fb571f1c9dbca 100644 (file)
@@ -77,7 +77,6 @@ analog triggering on 1602 series
 #include "8253.h"
 #include "8255.h"
 #include "amcc_s5933.h"
-#include "comedi_pci.h"
 #include "comedi_fc.h"
 
 #undef CB_PCIDAS_DEBUG         /*  disable debugging code */
index 9d0b8754ff5b55b4a94ab070db2b7e5a2d68a654..1e30f227e98e13f5fef16b190dd7bca6b317f6e7 100644 (file)
@@ -87,7 +87,6 @@ TODO:
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 
-#include "comedi_pci.h"
 #include "8253.h"
 #include "8255.h"
 #include "plx9080.h"
index 25ebca11eadc54e97e12315bcd4dbc3c56a7730b..dc4cf0b030efd17b2cefc4ab49640f54281651a7 100644 (file)
@@ -48,10 +48,8 @@ Please report success/failure with other different cards to
 
 #include "../comedidev.h"
 
-#include "comedi_pci.h"
 #include "8255.h"
 
-
 /* PCI vendor number of ComputerBoards */
 #define PCI_VENDOR_ID_CB        0x1307
 #define EEPROM_SIZE    128     /*  number of entries in eeprom */
index 713132c8dbb5cb71bebe0b60ab0323a61c76de25..58d5a3d257bd638acb7c28f9fee6f213eb3edd84 100644 (file)
@@ -41,7 +41,6 @@ Passing a zero for an option is the same as leaving it unspecified.
 
 /*------------------------------ HEADER FILES ---------------------------------*/
 #include "../comedidev.h"
-#include "comedi_pci.h"
 #include "8255.h"
 
 /*-------------------------- MACROS and DATATYPES -----------------------------*/
index 5f834d02ec24269b09c876e39a37d50cd689d731..a06b67a0b36dc5c80051d2149c67f74c1214985f 100644 (file)
@@ -45,7 +45,6 @@ See http://www.mccdaq.com/PDFs/Manuals/pcim-das1602-16.pdf for more details.
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 
-#include "comedi_pci.h"
 #include "plx9052.h"
 #include "8255.h"
 
index b339685e234d63d8b0abdae0c785d391fb452cd6..bec250bf15bbb643bd33556a18f0f7bd58f9d340 100644 (file)
@@ -86,8 +86,6 @@ Configuration Options:
 
 #include "../comedidev.h"
 
-#include "comedi_pci.h"
-
 #include "8255.h"
 
 /* device ids of the cards we support -- currently only 1 card supported */
diff --git a/drivers/staging/comedi/drivers/comedi_pci.h b/drivers/staging/comedi/drivers/comedi_pci.h
deleted file mode 100644 (file)
index c14a036..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
-    comedi/drivers/comedi_pci.h
-    Various PCI functions for drivers.
-
-    Copyright (C) 2007 MEV Ltd. <http://www.mev.co.uk/>
-
-    COMEDI - Linux Control and Measurement Device Interface
-    Copyright (C) 2000 David A. Schleef <ds@schleef.org>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef _COMEDI_PCI_H_
-#define _COMEDI_PCI_H_
-
-#include <linux/pci.h>
-
-/*
- * Enable the PCI device and request the regions.
- */
-static inline int comedi_pci_enable(struct pci_dev *pdev, const char *res_name)
-{
-       int rc;
-
-       rc = pci_enable_device(pdev);
-       if (rc < 0)
-               return rc;
-
-       rc = pci_request_regions(pdev, res_name);
-       if (rc < 0)
-               pci_disable_device(pdev);
-
-       return rc;
-}
-
-/*
- * Release the regions and disable the PCI device.
- *
- * This must be matched with a previous successful call to comedi_pci_enable().
- */
-static inline void comedi_pci_disable(struct pci_dev *pdev)
-{
-       pci_release_regions(pdev);
-       pci_disable_device(pdev);
-}
-
-#endif
index b8bac80f2baf5b31b2f0952af0d1d943da03b09a..2cd7407adbeaf9ce386faedde005b36929131f2f 100644 (file)
@@ -36,8 +36,6 @@ Configuration Options:
 
 #include "../comedidev.h"
 
-#include "comedi_pci.h"
-
 enum contec_model {
        PIO1616L = 0,
 };
index 696b58ca2e597a94953df6c2e50efe52f6c3f35a..d84794ca4380c319bb6a05f9260edd70a26bc5ae 100644 (file)
@@ -118,7 +118,6 @@ Configuration options:
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 
-#include "comedi_pci.h"
 #include "8255.h"
 
 #define DAQBOARD2000_SUBSYSTEM_IDS2    0x00021616      /* Daqboard/2000 - 2 Dacs */
index 1f319435e23f9a9ff89c894b6d0a9e247dd0eac2..f53e59776a3700c69b1ab0219e084a461a878695 100644 (file)
@@ -55,7 +55,6 @@
 
 #include <linux/delay.h>
 
-#include "comedi_pci.h"
 #include "8255.h"
 #include "das08.h"
 
index 0d273269b5724c4b09fecfc9f6c4cdb2832cd2d5..2c1c6140f38f550128150ec997ef6efd422b1538 100644 (file)
@@ -63,8 +63,6 @@ AO commands are not supported.
 #include "../comedidev.h"
 #include <linux/delay.h>
 
-#include "comedi_pci.h"
-
 #define PCI_VENDOR_ID_DT       0x1116
 
 static const struct comedi_lrange range_dt3000_ai = { 4, {
index b0cec7b1b0c9435c0fee75cd9610ed66aefe77b5..9586f24ded73a4383771fe3e4f82edb3b5b03a8f 100644 (file)
@@ -38,7 +38,6 @@
 */
 
 #include "../comedidev.h"
-#include "comedi_pci.h"
 #include <linux/mutex.h>
 
 #define PCI_VENDOR_ID_DYNALOG          0x10b5
index 8aece08bd0ddf2deec0e432e9aa94588c95284d1..79e22b13f734d66afb7586a3e9de1dec49022e2d 100644 (file)
@@ -49,7 +49,6 @@ support could be added to this driver.
 #include "../comedidev.h"
 #include <linux/delay.h>
 
-#include "comedi_pci.h"
 #include "plx9080.h"
 #include "comedi_fc.h"
 
index 68acefe16888bef038ef8f5df2c2ba43256d2557..dbf9908cfde644ecb13e9814836c9f461c2c06d5 100644 (file)
@@ -11,7 +11,6 @@
 #define _ICP_MULTI_H_
 
 #include "../comedidev.h"
-#include "comedi_pci.h"
 
 /****************************************************************************/
 
index d536a11edb951d0743d93d562b718ea5dfb5a721..e8dfc367aa8defef103d380055fd14ed24fd0d45 100644 (file)
@@ -49,7 +49,6 @@ Devices: [JR3] PCI force sensor board (jr3_pci)
 #include <linux/slab.h>
 #include <linux/timer.h>
 #include <linux/kernel.h>
-#include "comedi_pci.h"
 #include "jr3_pci.h"
 
 #define PCI_VENDOR_ID_JR3 0x1762
index 09d191844bf88f801b9031a767c89c8a17a03797..9f92420dd826979ba79d947973ec29509da77bc3 100644 (file)
@@ -40,8 +40,6 @@ Kolter Electronic PCI Counter Card.
 
 #include "../comedidev.h"
 
-#include "comedi_pci.h"
-
 #define CNT_DRIVER_NAME         "ke_counter"
 #define PCI_VENDOR_ID_KOLTER    0x1001
 #define CNT_CARD_DEVICE_ID      0x0014
index 8ca1b54600db21079a19311661f0063856d2ddd7..cb6bf8c5fb45b0d0e1d62e1b245b39d4efb62b92 100644 (file)
@@ -58,7 +58,6 @@ broken.
 #include <linux/list.h>
 #include <linux/spinlock.h>
 
-#include "comedi_pci.h"
 #include "me4000.h"
 #if 0
 /* file removed due to GPL incompatibility */
index ffe251250e6fc1e90584d6fde31b456783f69fcf..fcadb0fcd1d0e25d80a41901a428832a5fd64128 100644 (file)
@@ -54,8 +54,6 @@ from http://www.comedi.org
 #include <linux/sched.h>
 #include "../comedidev.h"
 
-#include "comedi_pci.h"
-
 /*#include "me2600_fw.h" */
 
 #define ME_DRIVER_NAME         "me_daq"
index 13e9c80716968df8b2bc9df3a46c7ee54f983104..a93166d6a8f8489b3fe1c5c94d6b9cd50dd534f6 100644 (file)
@@ -52,7 +52,6 @@
 #include "mite.h"
 
 #include "comedi_fc.h"
-#include "comedi_pci.h"
 #include "../comedidev.h"
 
 
index 1678a0ccb8c177b726b784f60c6502dcded542d7..d3e2786f07cbe15ea85118b4e3a5b886a5d614ed 100644 (file)
@@ -105,7 +105,6 @@ Configuration options:
 #include <linux/delay.h>
 
 #include "../comedidev.h"
-#include "comedi_pci.h"
 
 #define DRV_NAME "rtd520"
 
index 7beb8f6853af0a725d38f64c3a12c358f6924ca4..516037009dcdc4f59db1a77fb4eada84cc2afce4 100644 (file)
@@ -74,8 +74,6 @@ INSN_CONFIG instructions:
 
 #include "../comedidev.h"
 
-#include "comedi_pci.h"
-
 #include "comedi_fc.h"
 #include "s626.h"