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;
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,
};
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;
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,
};
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;
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,
};
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;
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,
};
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;
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,
};
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;
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,
};
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;
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,
};
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;
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,
};
}
/*
- * 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;
.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),
}
/*
- * 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)
.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),
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);
.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),
}
/*
- * 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)
}
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);
.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),
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)
{
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;
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,
};
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;
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,
};
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;
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,
};
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;
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,
};
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;
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,
};
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;
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,
};
/* 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;
.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),
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;
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,
};
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;
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,
};
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;
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,
};
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;
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,
};
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;
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,
};
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;
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,
};
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;
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,
};
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;
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,
};
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;
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,
};
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;
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,
};
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;
.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,
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;
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,
};
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;
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,
};
/* 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;
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,
};