summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2012-05-29 13:49:33 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-05 03:46:57 (GMT)
commit273ba547da12406d609795bc8976cb2464b15d82 (patch)
tree05cba310f151475089cca7db0604ec9950423d2d /drivers
parent916d7028a91a6a0e4b76e7cfb97819f294cbd803 (diff)
downloadlinux-fsl-qoriq-273ba547da12406d609795bc8976cb2464b15d82.tar.xz
staging: comedi: amplc_pc236: Change return type of pc236_find_pci()
pc236_find_pci() finds a supported PCI device, returning 0 on success or -EIO on failure and returning the pointer to the PCI device via a struct pci_dev ** parameter. Change it to return the struct pci_dev * on success or NULL on failure. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/comedi/drivers/amplc_pc236.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/staging/comedi/drivers/amplc_pc236.c b/drivers/staging/comedi/drivers/amplc_pc236.c
index 7926569..a94ac0e 100644
--- a/drivers/staging/comedi/drivers/amplc_pc236.c
+++ b/drivers/staging/comedi/drivers/amplc_pc236.c
@@ -151,14 +151,11 @@ struct pc236_private {
* bus and slot.
*/
#if IS_ENABLED(CONFIG_COMEDI_AMPLC_PC236_PCI)
-static int
-pc236_find_pci(struct comedi_device *dev, int bus, int slot,
- struct pci_dev **pci_dev_p)
+struct pci_dev *
+pc236_find_pci(struct comedi_device *dev, int bus, int slot)
{
struct pci_dev *pci_dev = NULL;
- *pci_dev_p = NULL;
-
/* Look for matching PCI device. */
for (pci_dev = pci_get_device(PCI_VENDOR_ID_AMPLICON, PCI_ANY_ID, NULL);
pci_dev != NULL;
@@ -192,8 +189,7 @@ pc236_find_pci(struct comedi_device *dev, int bus, int slot,
}
/* Found a match. */
- *pci_dev_p = pci_dev;
- return 0;
+ return pci_dev;
}
/* No match found. */
if (bus || slot) {
@@ -204,7 +200,7 @@ pc236_find_pci(struct comedi_device *dev, int bus, int slot,
dev_err(dev->class_dev, "error! no %s found!\n",
thisboard->name);
}
- return -EIO;
+ return NULL;
}
#endif
@@ -499,9 +495,9 @@ static int pc236_attach(struct comedi_device *dev, struct comedi_devconfig *it)
slot = it->options[1];
share_irq = 1;
- ret = pc236_find_pci(dev, bus, slot, &pci_dev);
- if (ret < 0)
- return ret;
+ pci_dev = pc236_find_pci(dev, bus, slot);
+ if (pci_dev == NULL)
+ return -EIO;
devpriv->pci_dev = pci_dev;
break;
#endif