aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2012-05-30 19:04:43 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-04 20:48:08 -0700
commit7ac75ba4f364fb655c89b4f9ccf1cfbdf9dfd370 (patch)
tree9cfe92dacece10135864593bfe7ca22f07092688
parent6ac682520ec3318f0a43582f642c0444ad5e3314 (diff)
staging: comedi: amplc_pc263: Change return type of pc263_find_pci()
pc263_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>
-rw-r--r--drivers/staging/comedi/drivers/amplc_pc263.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/staging/comedi/drivers/amplc_pc263.c b/drivers/staging/comedi/drivers/amplc_pc263.c
index 9fa98c4d27e0..dd0b4b20582b 100644
--- a/drivers/staging/comedi/drivers/amplc_pc263.c
+++ b/drivers/staging/comedi/drivers/amplc_pc263.c
@@ -113,14 +113,11 @@ struct pc263_private {
* This function looks for a PCI device matching the requested board name,
* bus and slot.
*/
-static int
-pc263_find_pci(struct comedi_device *dev, int bus, int slot,
- struct pci_dev **pci_dev_p)
+static struct pci_dev *
+pc263_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;
@@ -154,8 +151,7 @@ pc263_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) {
@@ -166,7 +162,7 @@ pc263_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;
}
/*
* This function checks and requests an I/O region, reporting an error
@@ -251,9 +247,9 @@ static int pc263_attach(struct comedi_device *dev, struct comedi_devconfig *it)
}
bus = it->options[0];
slot = it->options[1];
- ret = pc263_find_pci(dev, bus, slot, &pci_dev);
- if (ret < 0)
- return ret;
+ pci_dev = pc263_find_pci(dev, bus, slot);
+ if (pci_dev == NULL)
+ return -EIO;
devpriv->pci_dev = pci_dev;
ret = comedi_pci_enable(pci_dev, PC263_DRIVER_NAME);
if (ret < 0) {