[PATCH] staging: comedi: rtd520: use auto_attach instead of attach_pci

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Change the rtd520 driver to use the new `auto_attach()` method in
`struct comedi_driver` instead of the `attach_pci()` method.  I plan to
remove the `attach_pci()` and `attach_usb()` methods once nothing is
using them.

Tag the new `rtd520_auto_attach()` function definition with `__devinit`
as it is only called during PCI probe.

Signed-off-by: Ian Abbott <abbotti@xxxxxxxxx>
---
 drivers/staging/comedi/drivers/rtd520.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/rtd520.c b/drivers/staging/comedi/drivers/rtd520.c
index e42bd6b..23b76d0 100644
--- a/drivers/staging/comedi/drivers/rtd520.c
+++ b/drivers/staging/comedi/drivers/rtd520.c
@@ -1284,8 +1284,10 @@ static const void *rtd_find_boardinfo(struct comedi_device *dev,
 	return NULL;
 }
 
-static int rtd_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
+static int __devinit rtd_auto_attach(struct comedi_device *dev,
+				     unsigned long context_unused)
 {
+	struct pci_dev *pcidev = comedi_to_pci_dev(dev);
 	const struct rtdBoard *thisboard;
 	struct rtdPrivate *devpriv;
 	struct comedi_subdevice *s;
@@ -1420,7 +1422,7 @@ static void rtd_detach(struct comedi_device *dev)
 static struct comedi_driver rtd520_driver = {
 	.driver_name	= "rtd520",
 	.module		= THIS_MODULE,
-	.attach_pci	= rtd_attach_pci,
+	.auto_attach	= rtd_auto_attach,
 	.detach		= rtd_detach,
 };
 
-- 
1.7.12.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux