From: Ian Abbott Date: Wed, 24 Oct 2012 15:47:47 +0000 (+0100) Subject: staging: comedi: amplc_dio200: no need to manipulate PCI ref count X-Git-Tag: next-20121025~21^2~27 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f34e08f54f078cb4911962b43c2bd16c2f8ccce3;p=karo-tx-linux.git staging: comedi: amplc_dio200: no need to manipulate PCI ref count Now that this driver no longer supports "manual" attachment of PCI devices in its `attach` hook (`dio200_attach()`), it no longer has code that searches for a suitable PCI device and increments its reference count. Since the driver no longer has any reason for incrementing and decrementing the PCI device's reference count, the calls to `pci_dev_get()` and `pci_dev_put()` can be removed. Signed-off-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/amplc_dio200.c b/drivers/staging/comedi/drivers/amplc_dio200.c index c07f86b7a4a3..06550c999bac 100644 --- a/drivers/staging/comedi/drivers/amplc_dio200.c +++ b/drivers/staging/comedi/drivers/amplc_dio200.c @@ -1339,13 +1339,6 @@ static int __devinit dio200_attach_pci(struct comedi_device *dev, dev_err(dev->class_dev, "BUG! cannot determine board type!\n"); return -EINVAL; } - /* - * Need to 'get' the PCI device to match the 'put' in dio200_detach(). - * TODO: Remove the pci_dev_get() and matching pci_dev_put() once - * support for manual attachment of PCI devices via dio200_attach() - * has been removed. - */ - pci_dev_get(pci_dev); return dio200_pci_common_attach(dev, pci_dev); } @@ -1384,7 +1377,6 @@ static void dio200_detach(struct comedi_device *dev) if (pcidev) { if (dev->iobase) comedi_pci_disable(pcidev); - pci_dev_put(pcidev); } } }