staging: comedi/drivers: use auto_attach instead of attach_pci
authorIan Abbott <abbotti@mev.co.uk>
Tue, 30 Oct 2012 13:30:04 +0000 (13:30 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Oct 2012 17:53:50 +0000 (10:53 -0700)
Change comedi drivers for PCI boards to use the new `auto_attach()`
method instead of the `attach_pci()` method.  I plan to remove the
`attach_pci()` and `attach_usb()` methods from `struct comedi_driver`
once nothing is using them.

Tag the functions with `__devinit` where they are not already so tagged,
as they are only called during PCI probe.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
34 files changed:
drivers/staging/comedi/drivers/8255_pci.c
drivers/staging/comedi/drivers/adl_pci6208.c
drivers/staging/comedi/drivers/adl_pci7x3x.c
drivers/staging/comedi/drivers/adl_pci8164.c
drivers/staging/comedi/drivers/adl_pci9111.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_pcidda.c
drivers/staging/comedi/drivers/cb_pcimdas.c
drivers/staging/comedi/drivers/cb_pcimdda.c
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/icp_multi.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/ni_6527.c
drivers/staging/comedi/drivers/ni_65xx.c
drivers/staging/comedi/drivers/ni_660x.c
drivers/staging/comedi/drivers/ni_670x.c
drivers/staging/comedi/drivers/ni_labpc.c
drivers/staging/comedi/drivers/ni_pcidio.c
drivers/staging/comedi/drivers/ni_pcimio.c
drivers/staging/comedi/drivers/s626.c

index 2bb98d478f34a92282222c1427310aa74787df13..71ad619d9c605586fedb16874bd763ceffc61aa8 100644 (file)
@@ -213,9 +213,10 @@ static const void *pci_8255_find_boardinfo(struct comedi_device *dev,
        return NULL;
 }
 
-static int pci_8255_attach_pci(struct comedi_device *dev,
-                              struct pci_dev *pcidev)
+static int __devinit pci_8255_auto_attach(struct comedi_device *dev,
+                                         unsigned long context_unused)
 {
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        const struct pci_8255_boardinfo *board;
        struct pci_8255_private *devpriv;
        struct comedi_subdevice *s;
@@ -303,7 +304,7 @@ static void pci_8255_detach(struct comedi_device *dev)
 static struct comedi_driver pci_8255_driver = {
        .driver_name    = "8255_pci",
        .module         = THIS_MODULE,
-       .attach_pci     = pci_8255_attach_pci,
+       .auto_attach    = pci_8255_auto_attach,
        .detach         = pci_8255_detach,
 };
 
index 350e87dd04d9ee2228a88400c479f9272fd2af32..73fd9750327eec97018ba5c7f1df32c0fb85d91e 100644 (file)
@@ -174,9 +174,10 @@ static const void *pci6208_find_boardinfo(struct comedi_device *dev,
        return NULL;
 }
 
-static int pci6208_attach_pci(struct comedi_device *dev,
-                             struct pci_dev *pcidev)
+static int __devinit pci6208_auto_attach(struct comedi_device *dev,
+                                        unsigned long context_unused)
 {
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        const struct pci6208_board *boardinfo;
        struct pci6208_private *devpriv;
        struct comedi_subdevice *s;
@@ -259,7 +260,7 @@ static void pci6208_detach(struct comedi_device *dev)
 static struct comedi_driver adl_pci6208_driver = {
        .driver_name    = "adl_pci6208",
        .module         = THIS_MODULE,
-       .attach_pci     = pci6208_attach_pci,
+       .auto_attach    = pci6208_auto_attach,
        .detach         = pci6208_detach,
 };
 
index 8eee2fa0bf00bea1e68a20b7d05647a72766d097..be01b2021979e165e5347f50fddf17aa9d264923 100644 (file)
@@ -168,9 +168,10 @@ static const void *adl_pci7x3x_find_boardinfo(struct comedi_device *dev,
        return NULL;
 }
 
-static int adl_pci7x3x_attach_pci(struct comedi_device *dev,
-                                 struct pci_dev *pcidev)
+static int __devinit adl_pci7x3x_auto_attach(struct comedi_device *dev,
+                                            unsigned long context_unused)
 {
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        const struct adl_pci7x3x_boardinfo *board;
        struct comedi_subdevice *s;
        int subdev;
@@ -291,7 +292,7 @@ static void adl_pci7x3x_detach(struct comedi_device *dev)
 static struct comedi_driver adl_pci7x3x_driver = {
        .driver_name    = "adl_pci7x3x",
        .module         = THIS_MODULE,
-       .attach_pci     = adl_pci7x3x_attach_pci,
+       .auto_attach    = adl_pci7x3x_auto_attach,
        .detach         = adl_pci7x3x_detach,
 };
 
index 9999f938745eebc99a994560326af70661b8cb2c..41993ec436f6837030fd345b2c3e0068eca0593f 100644 (file)
@@ -212,9 +212,10 @@ static int adl_pci8164_insn_write_buf1(struct comedi_device *dev,
        return 2;
 }
 
-static int adl_pci8164_attach_pci(struct comedi_device *dev,
-                                 struct pci_dev *pcidev)
+static int __devinit adl_pci8164_auto_attach(struct comedi_device *dev,
+                                            unsigned long context_unused)
 {
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        struct comedi_subdevice *s;
        int ret;
 
@@ -287,7 +288,7 @@ static void adl_pci8164_detach(struct comedi_device *dev)
 static struct comedi_driver adl_pci8164_driver = {
        .driver_name    = "adl_pci8164",
        .module         = THIS_MODULE,
-       .attach_pci     = adl_pci8164_attach_pci,
+       .auto_attach    = adl_pci8164_auto_attach,
        .detach         = adl_pci8164_detach,
 };
 
index 236a88946d006d0f9b421e7abc1aa2296db97523..45f85f64eff4ed9cdd23520eef6249cf3f5a9ba2 100644 (file)
@@ -879,9 +879,10 @@ static int pci9111_reset(struct comedi_device *dev)
        return 0;
 }
 
-static int pci9111_attach_pci(struct comedi_device *dev,
-                             struct pci_dev *pcidev)
+static int __devinit pci9111_auto_attach(struct comedi_device *dev,
+                                        unsigned long context_unused)
 {
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        struct pci9111_private_data *dev_private;
        struct comedi_subdevice *s;
        int ret;
@@ -975,7 +976,7 @@ static void pci9111_detach(struct comedi_device *dev)
 static struct comedi_driver adl_pci9111_driver = {
        .driver_name    = "adl_pci9111",
        .module         = THIS_MODULE,
-       .attach_pci     = pci9111_attach_pci,
+       .auto_attach    = pci9111_auto_attach,
        .detach         = pci9111_detach,
 };
 
index dd83c749e6eda44c63be78270c527c5b83e7a993..d1f800aa2d3f947da7883f7a78fd5d8a75b7364c 100644 (file)
@@ -1255,9 +1255,10 @@ static const void *pci1710_find_boardinfo(struct comedi_device *dev,
        return NULL;
 }
 
-static int pci1710_attach_pci(struct comedi_device *dev,
-                             struct pci_dev *pcidev)
+static int __devinit pci1710_auto_attach(struct comedi_device *dev,
+                                        unsigned long context_unused)
 {
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        const struct boardtype *this_board;
        struct pci1710_private *devpriv;
        struct comedi_subdevice *s;
@@ -1413,7 +1414,7 @@ static void pci1710_detach(struct comedi_device *dev)
 static struct comedi_driver adv_pci1710_driver = {
        .driver_name    = "adv_pci1710",
        .module         = THIS_MODULE,
-       .attach_pci     = pci1710_attach_pci,
+       .auto_attach    = pci1710_auto_attach,
        .detach         = pci1710_detach,
 };
 
index 7109e7d8b9fc71b29f487ad106c3ad926934bef3..490e4347f11e08a6e6d6d65ead0f690ada15ab10 100644 (file)
@@ -232,9 +232,10 @@ static int pci1723_dio_insn_bits(struct comedi_device *dev,
        return insn->n;
 }
 
-static int pci1723_attach_pci(struct comedi_device *dev,
-                             struct pci_dev *pcidev)
+static int __devinit pci1723_auto_attach(struct comedi_device *dev,
+                                        unsigned long context_unused)
 {
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        struct pci1723_private *devpriv;
        struct comedi_subdevice *s;
        int ret;
@@ -316,7 +317,7 @@ static void pci1723_detach(struct comedi_device *dev)
 static struct comedi_driver adv_pci1723_driver = {
        .driver_name    = "adv_pci1723",
        .module         = THIS_MODULE,
-       .attach_pci     = pci1723_attach_pci,
+       .auto_attach    = pci1723_auto_attach,
        .detach         = pci1723_detach,
 };
 
index 131eb02324dd815bf3df9a09fbcd56e9d68a73ce..bb69c0d71ce5679ee4e704ee23b1cb8d0cd3b8d9 100644 (file)
@@ -1090,9 +1090,10 @@ static const void *pci_dio_find_boardinfo(struct comedi_device *dev,
        return NULL;
 }
 
-static int pci_dio_attach_pci(struct comedi_device *dev,
-                             struct pci_dev *pcidev)
+static int __devinit pci_dio_auto_attach(struct comedi_device *dev,
+                                        unsigned long context_unused)
 {
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        const struct dio_boardtype *this_board;
        struct pci_dio_private *devpriv;
        struct comedi_subdevice *s;
@@ -1195,7 +1196,7 @@ static void pci_dio_detach(struct comedi_device *dev)
 static struct comedi_driver adv_pci_dio_driver = {
        .driver_name    = "adv_pci_dio",
        .module         = THIS_MODULE,
-       .attach_pci     = pci_dio_attach_pci,
+       .auto_attach    = pci_dio_auto_attach,
        .detach         = pci_dio_detach,
 };
 
index ffe3f7385c7cff0191ea484a4f84896bba050ab6..cb75a177c9a2364c53b165c5e92aefc1bfcd4a12 100644 (file)
@@ -1943,13 +1943,14 @@ static int dio200_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 }
 
 /*
- * The attach_pci hook (if non-NULL) is called at PCI probe time in preference
- * to the "manual" attach hook.  dev->board_ptr is NULL on entry.  There should
- * be a board entry matching the supplied PCI device.
+ * The auto_attach hook is called at PCI probe time via
+ * comedi_pci_auto_config().  dev->board_ptr is NULL on entry.
+ * There should be a board entry matching the supplied PCI device.
  */
-static int __devinit dio200_attach_pci(struct comedi_device *dev,
-                                      struct pci_dev *pci_dev)
+static int __devinit dio200_auto_attach(struct comedi_device *dev,
+                                       unsigned long context_unused)
 {
+       struct pci_dev *pci_dev = comedi_to_pci_dev(dev);
        const struct dio200_board *thisboard;
        struct dio200_private *devpriv;
        resource_size_t base, len;
@@ -2074,7 +2075,7 @@ static struct comedi_driver amplc_dio200_driver = {
        .driver_name = DIO200_DRIVER_NAME,
        .module = THIS_MODULE,
        .attach = dio200_attach,
-       .attach_pci = dio200_attach_pci,
+       .auto_attach = dio200_auto_attach,
        .detach = dio200_detach,
        .board_name = &dio200_boards[0].name,
        .offset = sizeof(struct dio200_board),
index 8b7e16ee1135d467ac6369a895dbd853835839e8..ae75754dd777ddde3a331b099c5e0604151ce4cd 100644 (file)
@@ -537,13 +537,14 @@ static int pc236_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 }
 
 /*
- * The attach_pci hook (if non-NULL) is called at PCI probe time in preference
- * to the "manual" attach hook.  dev->board_ptr is NULL on entry.  There should
- * be a board entry matching the supplied PCI device.
+ * The auto_attach hook is called at PCI probe time via
+ * comedi_pci_auto_config().  dev->board_ptr is NULL on entry.
+ * There should be a board entry matching the supplied PCI device.
  */
-static int __devinit pc236_attach_pci(struct comedi_device *dev,
-                                     struct pci_dev *pci_dev)
+static int __devinit pc236_auto_attach(struct comedi_device *dev,
+                                      unsigned long context_unused)
 {
+       struct pci_dev *pci_dev = comedi_to_pci_dev(dev);
        struct pc236_private *devpriv;
 
        if (!DO_PCI)
@@ -607,7 +608,7 @@ static struct comedi_driver amplc_pc236_driver = {
        .driver_name = PC236_DRIVER_NAME,
        .module = THIS_MODULE,
        .attach = pc236_attach,
-       .attach_pci = pc236_attach_pci,
+       .auto_attach = pc236_auto_attach,
        .detach = pc236_detach,
        .board_name = &pc236_boards[0].name,
        .offset = sizeof(struct pc236_board),
index 6ffb39c3931445b4adb07c334479a060ef12c2bc..dc9504914e2b699c85261f4f209593daae7287f0 100644 (file)
@@ -290,17 +290,21 @@ static int pc263_attach(struct comedi_device *dev, struct comedi_devconfig *it)
                return -EINVAL;
        }
 }
+
 /*
- * The attach_pci hook (if non-NULL) is called at PCI probe time in preference
- * to the "manual" attach hook.  dev->board_ptr is NULL on entry.  There should
- * be a board entry matching the supplied PCI device.
+ * The auto_attach hook is called at PCI probe time via
+ * comedi_pci_auto_config().  dev->board_ptr is NULL on entry.
+ * There should be a board entry matching the supplied PCI device.
  */
-static int __devinit pc263_attach_pci(struct comedi_device *dev,
-                                     struct pci_dev *pci_dev)
+static int __devinit pc263_auto_attach(struct comedi_device *dev,
+                                      unsigned long context_unused)
 {
+       struct pci_dev *pci_dev;
+
        if (!DO_PCI)
                return -EINVAL;
 
+       pci_dev = comedi_to_pci_dev(dev);
        dev_info(dev->class_dev, PC263_DRIVER_NAME ": attach pci %s\n",
                 pci_name(pci_dev));
        dev->board_ptr = pc263_find_pci_board(pci_dev);
@@ -347,7 +351,7 @@ static struct comedi_driver amplc_pc263_driver = {
        .driver_name = PC263_DRIVER_NAME,
        .module = THIS_MODULE,
        .attach = pc263_attach,
-       .attach_pci = pc263_attach_pci,
+       .auto_attach = pc263_auto_attach,
        .detach = pc263_detach,
        .board_name = &pc263_boards[0].name,
        .offset = sizeof(struct pc263_board),
index 610f2ce8fa12c68cb939ca2645599072ebab749a..e997f6e446d7b3769d072e467f1b6f5ab0be6208 100644 (file)
@@ -1286,7 +1286,7 @@ static void pci224_report_attach(struct comedi_device *dev, unsigned int irq)
 }
 
 /*
- * Common part of attach and attach_pci.
+ * Common part of attach and auto_attach.
  */
 static int pci224_attach_common(struct comedi_device *dev,
                                struct pci_dev *pci_dev, int *options)
@@ -1460,11 +1460,12 @@ static int pci224_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 }
 
 static int __devinit
-pci224_attach_pci(struct comedi_device *dev, struct pci_dev *pci_dev)
+pci224_auto_attach(struct comedi_device *dev, unsigned long context_unused)
 {
+       struct pci_dev *pci_dev = comedi_to_pci_dev(dev);
        struct pci224_private *devpriv;
 
-       dev_info(dev->class_dev, DRIVER_NAME ": attach_pci %s\n",
+       dev_info(dev->class_dev, DRIVER_NAME ": attach pci %s\n",
                 pci_name(pci_dev));
 
        devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
@@ -1519,7 +1520,7 @@ static struct comedi_driver amplc_pci224_driver = {
        .module         = THIS_MODULE,
        .attach         = pci224_attach,
        .detach         = pci224_detach,
-       .attach_pci     = pci224_attach_pci,
+       .auto_attach    = pci224_auto_attach,
        .board_name     = &pci224_boards[0].name,
        .offset         = sizeof(struct pci224_board),
        .num_names      = ARRAY_SIZE(pci224_boards),
index db67c8313ca8bf669fb8002ef1ff9e3a9b14e69d..ef87946e6422b0f187b2668cb51d2643f87dc90b 100644 (file)
@@ -2672,7 +2672,7 @@ static int pci230_alloc_private(struct comedi_device *dev)
        return 0;
 }
 
-/* Common part of attach and attach_pci. */
+/* Common part of attach and auto_attach. */
 static int pci230_attach_common(struct comedi_device *dev,
                                struct pci_dev *pci_dev)
 {
index 8e88573d270f58d750306841e440c30f333015ad..e7314e5f7264639c49c1b323a5446780d5fedbfd 100644 (file)
@@ -1466,9 +1466,10 @@ static const void *cb_pcidas_find_boardinfo(struct comedi_device *dev,
        return NULL;
 }
 
-static int cb_pcidas_attach_pci(struct comedi_device *dev,
-                               struct pci_dev *pcidev)
+static int __devinit cb_pcidas_auto_attach(struct comedi_device *dev,
+                                          unsigned long context_unused)
 {
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        const struct cb_pcidas_board *thisboard;
        struct cb_pcidas_private *devpriv;
        struct comedi_subdevice *s;
@@ -1651,7 +1652,7 @@ static void cb_pcidas_detach(struct comedi_device *dev)
 static struct comedi_driver cb_pcidas_driver = {
        .driver_name    = "cb_pcidas",
        .module         = THIS_MODULE,
-       .attach_pci     = cb_pcidas_attach_pci,
+       .auto_attach    = cb_pcidas_auto_attach,
        .detach         = cb_pcidas_detach,
 };
 
index eb03032ccfeacbf87e6386b8b485e105da969c70..083bd8636ef9f855d050c833fe0b1140bbb241d1 100644 (file)
@@ -349,9 +349,10 @@ static const void *cb_pcidda_find_boardinfo(struct comedi_device *dev,
        return NULL;
 }
 
-static int cb_pcidda_attach_pci(struct comedi_device *dev,
-                               struct pci_dev *pcidev)
+static int __devinit cb_pcidda_auto_attach(struct comedi_device *dev,
+                                          unsigned long context_unused)
 {
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        const struct cb_pcidda_board *thisboard;
        struct cb_pcidda_private *devpriv;
        struct comedi_subdevice *s;
@@ -427,7 +428,7 @@ static void cb_pcidda_detach(struct comedi_device *dev)
 static struct comedi_driver cb_pcidda_driver = {
        .driver_name    = "cb_pcidda",
        .module         = THIS_MODULE,
-       .attach_pci     = cb_pcidda_attach_pci,
+       .auto_attach    = cb_pcidda_auto_attach,
        .detach         = cb_pcidda_detach,
 };
 
index b093c9d939de8ff735119769f8688bd86087899d..f75873740bc3cbf455d1ea8ca250437781dc2b0a 100644 (file)
@@ -205,9 +205,10 @@ static int cb_pcimdas_ao_rinsn(struct comedi_device *dev,
        return i;
 }
 
-static int cb_pcimdas_attach_pci(struct comedi_device *dev,
-                                struct pci_dev *pcidev)
+static int __devinit cb_pcimdas_auto_attach(struct comedi_device *dev,
+                                           unsigned long context_unused)
 {
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        struct cb_pcimdas_private *devpriv;
        struct comedi_subdevice *s;
        unsigned long iobase_8255;
@@ -288,7 +289,7 @@ static void cb_pcimdas_detach(struct comedi_device *dev)
 static struct comedi_driver cb_pcimdas_driver = {
        .driver_name    = "cb_pcimdas",
        .module         = THIS_MODULE,
-       .attach_pci     = cb_pcimdas_attach_pci,
+       .auto_attach    = cb_pcimdas_auto_attach,
        .detach         = cb_pcimdas_detach,
 };
 
index 94aa2af57ebf98aaca8cd1df358bfb04be7cea62..89c70385330e9674d2c3d60c9077ba5f121db8c6 100644 (file)
@@ -151,9 +151,10 @@ static int cb_pcimdda_ao_rinsn(struct comedi_device *dev,
        return insn->n;
 }
 
-static int cb_pcimdda_attach_pci(struct comedi_device *dev,
-                                struct pci_dev *pcidev)
+static int __devinit cb_pcimdda_auto_attach(struct comedi_device *dev,
+                                           unsigned long context_unused)
 {
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        struct cb_pcimdda_private *devpriv;
        struct comedi_subdevice *s;
        int ret;
@@ -211,7 +212,7 @@ static void cb_pcimdda_detach(struct comedi_device *dev)
 static struct comedi_driver cb_pcimdda_driver = {
        .driver_name    = "cb_pcimdda",
        .module         = THIS_MODULE,
-       .attach_pci     = cb_pcimdda_attach_pci,
+       .auto_attach    = cb_pcimdda_auto_attach,
        .detach         = cb_pcimdda_detach,
 };
 
index 70a9243cf33c1c51dd3dae5f06312546ed8bd596..c06b7b682f7d4aacef4a70a2cdee562b366826eb 100644 (file)
@@ -68,9 +68,10 @@ static int contec_di_insn_bits(struct comedi_device *dev,
        return insn->n;
 }
 
-static int contec_attach_pci(struct comedi_device *dev,
-                            struct pci_dev *pcidev)
+static int __devinit contec_auto_attach(struct comedi_device *dev,
+                                       unsigned long context_unused)
 {
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        struct comedi_subdevice *s;
        int ret;
 
@@ -119,7 +120,7 @@ static void contec_detach(struct comedi_device *dev)
 static struct comedi_driver contec_pci_dio_driver = {
        .driver_name    = "contec_pci_dio",
        .module         = THIS_MODULE,
-       .attach_pci     = contec_attach_pci,
+       .auto_attach    = contec_auto_attach,
        .detach         = contec_detach,
 };
 
index 8bc6189c578e6866d911face2c468f0e7a832b70..c5aa6b8d8f7b9f62dbe41f2b70969abc529c138e 100644 (file)
@@ -688,9 +688,10 @@ static const void *daqboard2000_find_boardinfo(struct comedi_device *dev,
        return NULL;
 }
 
-static int daqboard2000_attach_pci(struct comedi_device *dev,
-                                  struct pci_dev *pcidev)
+static int __devinit daqboard2000_auto_attach(struct comedi_device *dev,
+                                             unsigned long context_unused)
 {
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        const struct daq200_boardtype *board;
        struct daqboard2000_private *devpriv;
        struct comedi_subdevice *s;
@@ -788,7 +789,7 @@ static void daqboard2000_detach(struct comedi_device *dev)
 static struct comedi_driver daqboard2000_driver = {
        .driver_name    = "daqboard2000",
        .module         = THIS_MODULE,
-       .attach_pci     = daqboard2000_attach_pci,
+       .auto_attach    = daqboard2000_auto_attach,
        .detach         = daqboard2000_detach,
 };
 
index d7582b96bf1c8923e609b24d5abd53de72d084c8..cc654542a6d26e7a18d258d15d337fd886ed72b9 100644 (file)
@@ -775,14 +775,16 @@ das08_find_pci_board(struct pci_dev *pdev)
 
 /* only called in the PCI probe path, via comedi_pci_auto_config() */
 static int __devinit __maybe_unused
-das08_attach_pci(struct comedi_device *dev, struct pci_dev *pdev)
+das08_auto_attach(struct comedi_device *dev, unsigned long context_unused)
 {
+       struct pci_dev *pdev;
        struct das08_private_struct *devpriv;
        unsigned long iobase;
 
        if (!DO_PCI)
                return -EINVAL;
 
+       pdev = comedi_to_pci_dev(dev);
        devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
        if (!devpriv)
                return -ENOMEM;
@@ -867,7 +869,7 @@ static struct comedi_driver das08_driver = {
        .driver_name = DRV_NAME,
        .module = THIS_MODULE,
        .attach = das08_attach,
-       .attach_pci = das08_attach_pci,
+       .auto_attach = das08_auto_attach,
        .detach = das08_detach,
        .board_name = &das08_boards[0].name,
        .num_names = sizeof(das08_boards) / sizeof(struct das08_board_struct),
index 3897960108a0e51ed0c9483679d4842b9b64f3e0..71c24954640ba9d9ab4853c93a9ace4d94edd0b9 100644 (file)
@@ -749,9 +749,10 @@ static const void *dt3000_find_boardinfo(struct comedi_device *dev,
        return NULL;
 }
 
-static int dt3000_attach_pci(struct comedi_device *dev,
-                            struct pci_dev *pcidev)
+static int __devinit dt3000_auto_attach(struct comedi_device *dev,
+                                       unsigned long context_unused)
 {
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        const struct dt3k_boardtype *this_board;
        struct dt3k_private *devpriv;
        struct comedi_subdevice *s;
@@ -866,7 +867,7 @@ static void dt3000_detach(struct comedi_device *dev)
 static struct comedi_driver dt3000_driver = {
        .driver_name    = "dt3000",
        .module         = THIS_MODULE,
-       .attach_pci     = dt3000_attach_pci,
+       .auto_attach    = dt3000_auto_attach,
        .detach         = dt3000_detach,
 };
 
index 656d08b20dbff8b66660f864a977efc75e116eaa..363b09d217ea96cebc4ebe74ea8d873bf64a03ef 100644 (file)
@@ -177,9 +177,10 @@ static int dyna_pci10xx_do_insn_bits(struct comedi_device *dev,
        return insn->n;
 }
 
-static int dyna_pci10xx_attach_pci(struct comedi_device *dev,
-                                  struct pci_dev *pcidev)
+static int __devinit dyna_pci10xx_auto_attach(struct comedi_device *dev,
+                                             unsigned long context_unused)
 {
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        struct dyna_pci10xx_private *devpriv;
        struct comedi_subdevice *s;
        int ret;
@@ -265,7 +266,7 @@ static void dyna_pci10xx_detach(struct comedi_device *dev)
 static struct comedi_driver dyna_pci10xx_driver = {
        .driver_name    = "dyna_pci10xx",
        .module         = THIS_MODULE,
-       .attach_pci     = dyna_pci10xx_attach_pci,
+       .auto_attach    = dyna_pci10xx_auto_attach,
        .detach         = dyna_pci10xx_detach,
 };
 
index 51af903773e296978c0966b810121e5a9ace2a11..e7bb6031e54bdf761608d89c9ffd376595a818d3 100644 (file)
@@ -494,9 +494,10 @@ static int icp_multi_reset(struct comedi_device *dev)
        return 0;
 }
 
-static int icp_multi_attach_pci(struct comedi_device *dev,
-                               struct pci_dev *pcidev)
+static int __devinit icp_multi_auto_attach(struct comedi_device *dev,
+                                          unsigned long context_unused)
 {
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        struct icp_multi_private *devpriv;
        struct comedi_subdevice *s;
        resource_size_t iobase;
@@ -612,7 +613,7 @@ static void icp_multi_detach(struct comedi_device *dev)
 static struct comedi_driver icp_multi_driver = {
        .driver_name    = "icp_multi",
        .module         = THIS_MODULE,
-       .attach_pci     = icp_multi_attach_pci,
+       .auto_attach    = icp_multi_auto_attach,
        .detach         = icp_multi_detach,
 };
 
index 8780a12ef59c2c0914cfb9e323e0e4e80590648b..a59a12b4f19302fcb196d225f2fe7919a370e278 100644 (file)
@@ -87,9 +87,10 @@ static int cnt_rinsn(struct comedi_device *dev,
        return 1;
 }
 
-static int cnt_attach_pci(struct comedi_device *dev,
-                         struct pci_dev *pcidev)
+static int __devinit cnt_auto_attach(struct comedi_device *dev,
+                                    unsigned long context_unused)
 {
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        struct comedi_subdevice *s;
        int ret;
 
@@ -141,7 +142,7 @@ static void cnt_detach(struct comedi_device *dev)
 static struct comedi_driver ke_counter_driver = {
        .driver_name    = "ke_counter",
        .module         = THIS_MODULE,
-       .attach_pci     = cnt_attach_pci,
+       .auto_attach    = cnt_auto_attach,
        .detach         = cnt_detach,
 };
 
index 322c8849b520fc4beda1fa2547364bddb8081f15..c85e5e5420b56b4d07db5a3be583ecd5a387271c 100644 (file)
@@ -1568,9 +1568,10 @@ static const void *me4000_find_boardinfo(struct comedi_device *dev,
        return NULL;
 }
 
-static int me4000_attach_pci(struct comedi_device *dev,
-                            struct pci_dev *pcidev)
+static int __devinit me4000_auto_attach(struct comedi_device *dev,
+                                       unsigned long context_unused)
 {
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        const struct me4000_board *thisboard;
        struct me4000_info *info;
        struct comedi_subdevice *s;
@@ -1728,7 +1729,7 @@ static void me4000_detach(struct comedi_device *dev)
 static struct comedi_driver me4000_driver = {
        .driver_name    = "me4000",
        .module         = THIS_MODULE,
-       .attach_pci     = me4000_attach_pci,
+       .auto_attach    = me4000_auto_attach,
        .detach         = me4000_detach,
 };
 
index 6a2dbdf9f0d17b11e237b0240e4b3389a5ef09ef..b1fd74c3a61f860bf63b183af28fa27124871a92 100644 (file)
@@ -542,8 +542,10 @@ static const void *me_find_boardinfo(struct comedi_device *dev,
        return NULL;
 }
 
-static int me_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
+static int __devinit me_auto_attach(struct comedi_device *dev,
+                                   unsigned long context_unused)
 {
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        const struct me_board *board;
        struct me_private_data *dev_private;
        struct comedi_subdevice *s;
@@ -653,7 +655,7 @@ static void me_detach(struct comedi_device *dev)
 static struct comedi_driver me_daq_driver = {
        .driver_name    = "me_daq",
        .module         = THIS_MODULE,
-       .attach_pci     = me_attach_pci,
+       .auto_attach    = me_auto_attach,
        .detach         = me_detach,
 };
 
index d853e75be7910b798f0401d9fc7809f6c9c01e85..112742ebad9a159db73308b4f4e98d5d192a91d8 100644 (file)
@@ -357,9 +357,10 @@ ni6527_find_boardinfo(struct pci_dev *pcidev)
        return NULL;
 }
 
-static int __devinit ni6527_attach_pci(struct comedi_device *dev,
-                                      struct pci_dev *pcidev)
+static int __devinit ni6527_auto_attach(struct comedi_device *dev,
+                                       unsigned long context_unused)
 {
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        struct ni6527_private *devpriv;
        struct comedi_subdevice *s;
        int ret;
@@ -457,7 +458,7 @@ static void ni6527_detach(struct comedi_device *dev)
 static struct comedi_driver ni6527_driver = {
        .driver_name = DRIVER_NAME,
        .module = THIS_MODULE,
-       .attach_pci = ni6527_attach_pci,
+       .auto_attach = ni6527_auto_attach,
        .detach = ni6527_detach,
 };
 
index 19d5e8c96e8f72c6ba819766cd5ddc9d79049f91..df7a3df83ba3b23207181cd640af4f0eb775dfff 100644 (file)
@@ -627,9 +627,10 @@ ni_65xx_find_boardinfo(struct pci_dev *pcidev)
        return NULL;
 }
 
-static int __devinit ni_65xx_attach_pci(struct comedi_device *dev,
-                                       struct pci_dev *pcidev)
+static int __devinit ni_65xx_auto_attach(struct comedi_device *dev,
+                                        unsigned long context_unused)
 {
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        struct ni_65xx_private *devpriv;
        struct comedi_subdevice *s;
        unsigned i;
@@ -793,7 +794,7 @@ static void ni_65xx_detach(struct comedi_device *dev)
 static struct comedi_driver ni_65xx_driver = {
        .driver_name = "ni_65xx",
        .module = THIS_MODULE,
-       .attach_pci = ni_65xx_attach_pci,
+       .auto_attach = ni_65xx_auto_attach,
        .detach = ni_65xx_detach,
 };
 
index 318057546485af43bbdf1ea0fb5bddaa73037dac..d1561c72e2d3d81ecbf0b26309e8625e9c218101 100644 (file)
@@ -1166,9 +1166,10 @@ static int ni_660x_dio_insn_config(struct comedi_device *dev,
        return insn->n;
 }
 
-static int __devinit ni_660x_attach_pci(struct comedi_device *dev,
-                                       struct pci_dev *pcidev)
+static int __devinit ni_660x_auto_attach(struct comedi_device *dev,
+                                        unsigned long context_unused)
 {
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        const struct ni_660x_board *board;
        struct ni_660x_private *devpriv;
        struct comedi_subdevice *s;
@@ -1316,7 +1317,7 @@ static void ni_660x_detach(struct comedi_device *dev)
 static struct comedi_driver ni_660x_driver = {
        .driver_name    = "ni_660x",
        .module         = THIS_MODULE,
-       .attach_pci     = ni_660x_attach_pci,
+       .auto_attach    = ni_660x_auto_attach,
        .detach         = ni_660x_detach,
 };
 
index 2cf4907c366acc4f6ad5ac1f803994d9ece32dc9..36462d582e49ae3da4932edb4791acf8da469147 100644 (file)
@@ -201,9 +201,10 @@ ni_670x_find_boardinfo(struct pci_dev *pcidev)
        return NULL;
 }
 
-static int __devinit ni_670x_attach_pci(struct comedi_device *dev,
-                                       struct pci_dev *pcidev)
+static int __devinit ni_670x_auto_attach(struct comedi_device *dev,
+                                        unsigned long context_unused)
 {
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        const struct ni_670x_board *thisboard;
        struct ni_670x_private *devpriv;
        struct comedi_subdevice *s;
@@ -298,7 +299,7 @@ static void ni_670x_detach(struct comedi_device *dev)
 static struct comedi_driver ni_670x_driver = {
        .driver_name    = "ni_670x",
        .module         = THIS_MODULE,
-       .attach_pci     = ni_670x_attach_pci,
+       .auto_attach    = ni_670x_auto_attach,
        .detach         = ni_670x_detach,
 };
 
index ab51c2678b9d425762d182951d6a183ba0cb585f..f4a0377486ee1f8fffe523a5c95906cdee751e38 100644 (file)
@@ -696,9 +696,10 @@ labpc_pci_find_boardinfo(struct pci_dev *pcidev)
        return NULL;
 }
 
-static int __devinit labpc_attach_pci(struct comedi_device *dev,
-                                     struct pci_dev *pcidev)
+static int __devinit labpc_auto_attach(struct comedi_device *dev,
+                                      unsigned long context_unused)
 {
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        struct labpc_private *devpriv;
        unsigned long iobase;
        unsigned int irq;
@@ -2117,7 +2118,7 @@ static struct comedi_driver labpc_driver = {
        .driver_name = DRV_NAME,
        .module = THIS_MODULE,
        .attach = labpc_attach,
-       .attach_pci = labpc_attach_pci,
+       .auto_attach = labpc_auto_attach,
        .detach = labpc_common_detach,
        .num_names = ARRAY_SIZE(labpc_boards),
        .board_name = &labpc_boards[0].name,
index 0a556c7f9bc42bb8e92d080be23a4f846146976c..20e7545204b8f98ac567046b63192683b1d8f40a 100644 (file)
@@ -1120,9 +1120,10 @@ nidio_find_boardinfo(struct pci_dev *pcidev)
        return NULL;
 }
 
-static int __devinit nidio_attach_pci(struct comedi_device *dev,
-                                     struct pci_dev *pcidev)
+static int __devinit nidio_auto_attach(struct comedi_device *dev,
+                                      unsigned long context_unused)
 {
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        struct nidio96_private *devpriv;
        struct comedi_subdevice *s;
        int ret;
@@ -1227,7 +1228,7 @@ static void nidio_detach(struct comedi_device *dev)
 static struct comedi_driver ni_pcidio_driver = {
        .driver_name    = "ni_pcidio",
        .module         = THIS_MODULE,
-       .attach_pci     = nidio_attach_pci,
+       .auto_attach    = nidio_auto_attach,
        .detach         = nidio_detach,
 };
 
index 4adb4ba545caf439c3e41c8dfb539ba324ffa019..65e1896c077f4684c0e7627db47c0faec764476c 100644 (file)
@@ -1620,9 +1620,10 @@ pcimio_find_boardinfo(struct pci_dev *pcidev)
        return NULL;
 }
 
-static int __devinit pcimio_attach_pci(struct comedi_device *dev,
-                                      struct pci_dev *pcidev)
+static int __devinit pcimio_auto_attach(struct comedi_device *dev,
+                                       unsigned long context_unused)
 {
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        struct ni_private *devpriv;
        int ret;
 
@@ -1780,7 +1781,7 @@ static int pcimio_dio_change(struct comedi_device *dev,
 static struct comedi_driver ni_pcimio_driver = {
        .driver_name    = "ni_pcimio",
        .module         = THIS_MODULE,
-       .attach_pci     = pcimio_attach_pci,
+       .auto_attach    = pcimio_auto_attach,
        .detach         = pcimio_detach,
 };
 
index 15755325121dbb9174200532e93151484b4fb973..686ee0e8713a065ea4468c3510998e1f2a082e74 100644 (file)
@@ -2691,8 +2691,10 @@ static void s626_initialize(struct comedi_device *dev)
        /* writel(IRQ_GPIO3 | IRQ_RPS1, devpriv->base_addr + P_IER); */
 }
 
-static int s626_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
+static int __devinit s626_auto_attach(struct comedi_device *dev,
+                                     unsigned long context_unused)
 {
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        struct s626_private *devpriv;
        struct comedi_subdevice *s;
        int ret;
@@ -2858,7 +2860,7 @@ static void s626_detach(struct comedi_device *dev)
 static struct comedi_driver s626_driver = {
        .driver_name    = "s626",
        .module         = THIS_MODULE,
-       .attach_pci     = s626_attach_pci,
+       .auto_attach    = s626_auto_attach,
        .detach         = s626_detach,
 };