summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/drivers/amplc_pci224.c
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2012-10-30 13:30:04 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-30 10:53:50 -0700
commit750af5e568d060ec6994cdcb4e86cdddfcd473c0 (patch)
treeccd15b343093357003759fbe7787bcb4e1cc0281 /drivers/staging/comedi/drivers/amplc_pci224.c
parent807e65b0a818cd9b1604144af379bcabd24d4b85 (diff)
staging: comedi/drivers: use auto_attach instead of attach_pci
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>
Diffstat (limited to 'drivers/staging/comedi/drivers/amplc_pci224.c')
-rw-r--r--drivers/staging/comedi/drivers/amplc_pci224.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c b/drivers/staging/comedi/drivers/amplc_pci224.c
index 610f2ce8fa12..e997f6e446d7 100644
--- a/drivers/staging/comedi/drivers/amplc_pci224.c
+++ b/drivers/staging/comedi/drivers/amplc_pci224.c
@@ -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),