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_dio200.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_dio200.c')
-rw-r--r-- | drivers/staging/comedi/drivers/amplc_dio200.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/staging/comedi/drivers/amplc_dio200.c b/drivers/staging/comedi/drivers/amplc_dio200.c index ffe3f7385c7c..cb75a177c9a2 100644 --- a/drivers/staging/comedi/drivers/amplc_dio200.c +++ b/drivers/staging/comedi/drivers/amplc_dio200.c @@ -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), |