Commit c3961470 authored by Ian Abbott's avatar Ian Abbott Committed by Greg Kroah-Hartman

staging: comedi: das08: No need to manipulate PCI ref count

Now that this driver no longer supports "manual" attachment of PCI
devices in its `attach` hook (`das08_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: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fd445899
...@@ -793,13 +793,6 @@ das08_attach_pci(struct comedi_device *dev, struct pci_dev *pdev) ...@@ -793,13 +793,6 @@ das08_attach_pci(struct comedi_device *dev, struct pci_dev *pdev)
dev_err(dev->class_dev, "BUG! cannot determine board type!\n"); dev_err(dev->class_dev, "BUG! cannot determine board type!\n");
return -EINVAL; return -EINVAL;
} }
/*
* Need to 'get' the PCI device to match the 'put' in das08_detach().
* TODO: Remove the pci_dev_get() and matching pci_dev_put() once
* support for manual attachment of PCI devices via das08_attach()
* has been removed.
*/
pci_dev_get(pdev);
devpriv = dev->private; devpriv = dev->private;
devpriv->pdev = pdev; devpriv->pdev = pdev;
/* enable PCI device and reserve I/O spaces */ /* enable PCI device and reserve I/O spaces */
...@@ -864,7 +857,6 @@ static void __maybe_unused das08_detach(struct comedi_device *dev) ...@@ -864,7 +857,6 @@ static void __maybe_unused das08_detach(struct comedi_device *dev)
if (devpriv && devpriv->pdev) { if (devpriv && devpriv->pdev) {
if (dev->iobase) if (dev->iobase)
comedi_pci_disable(devpriv->pdev); comedi_pci_disable(devpriv->pdev);
pci_dev_put(devpriv->pdev);
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment