diff options
author | Ian Abbott <abbotti@mev.co.uk> | 2012-10-30 13:30:04 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-30 10:53:50 -0700 |
commit | 750af5e568d060ec6994cdcb4e86cdddfcd473c0 (patch) | |
tree | ccd15b343093357003759fbe7787bcb4e1cc0281 /drivers/staging/comedi/drivers/amplc_pc263.c | |
parent | 807e65b0a818cd9b1604144af379bcabd24d4b85 (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_pc263.c')
-rw-r--r-- | drivers/staging/comedi/drivers/amplc_pc263.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/staging/comedi/drivers/amplc_pc263.c b/drivers/staging/comedi/drivers/amplc_pc263.c index 6ffb39c3931..dc9504914e2 100644 --- a/drivers/staging/comedi/drivers/amplc_pc263.c +++ b/drivers/staging/comedi/drivers/amplc_pc263.c @@ -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), |