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

staging: comedi: amplc_dio200: remove manual configuration of PCI boards

Remove the code that allows PCI boards to be manually attached by the
`COMEDI_DEVCONFIG` ioctl (or the "comedi_config" application).
Supported PCI boards will be attached automatically at probe time via
`comedi_pci_auto_config()` and the `attach_pci` hook in the `struct
comedi_driver`.
Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 41b25f87
...@@ -29,8 +29,7 @@ ...@@ -29,8 +29,7 @@
* Description: Amplicon 200 Series Digital I/O * Description: Amplicon 200 Series Digital I/O
* Author: Ian Abbott <abbotti@mev.co.uk> * Author: Ian Abbott <abbotti@mev.co.uk>
* Devices: [Amplicon] PC212E (pc212e), PC214E (pc214e), PC215E (pc215e), * Devices: [Amplicon] PC212E (pc212e), PC214E (pc214e), PC215E (pc215e),
* PCI215 (pci215 or amplc_dio200), PC218E (pc218e), PC272E (pc272e), * PCI215 (pci215), PC218E (pc218e), PC272E (pc272e), PCI272 (pci272)
* PCI272 (pci272 or amplc_dio200)
* Updated: Wed, 22 Oct 2008 13:36:02 +0100 * Updated: Wed, 22 Oct 2008 13:36:02 +0100
* Status: works * Status: works
* *
...@@ -38,11 +37,8 @@ ...@@ -38,11 +37,8 @@
* [0] - I/O port base address * [0] - I/O port base address
* [1] - IRQ (optional, but commands won't work without it) * [1] - IRQ (optional, but commands won't work without it)
* *
* Configuration options - PCI215, PCI272: * Manual configuration of PCI cards is not supported; they are configured
* [0] - PCI bus of device (optional) * automatically.
* [1] - PCI slot of device (optional)
* If bus/slot is not specified, the first available PCI device will
* be used.
* *
* Passing a zero for an option is the same as leaving it unspecified. * Passing a zero for an option is the same as leaving it unspecified.
* *
...@@ -272,7 +268,6 @@ enum dio200_model { ...@@ -272,7 +268,6 @@ enum dio200_model {
pc215e_model, pci215_model, pc215e_model, pci215_model,
pc218e_model, pc218e_model,
pc272e_model, pci272_model, pc272e_model, pci272_model,
anypci_model
}; };
enum dio200_layout { enum dio200_layout {
...@@ -343,12 +338,6 @@ static const struct dio200_board dio200_boards[] = { ...@@ -343,12 +338,6 @@ static const struct dio200_board dio200_boards[] = {
.model = pci272_model, .model = pci272_model,
.layout = pc272_layout, .layout = pc272_layout,
}, },
{
.name = DIO200_DRIVER_NAME,
.devid = PCI_DEVICE_ID_INVALID,
.bustype = pci_bustype,
.model = anypci_model, /* wildcard */
},
#endif #endif
}; };
...@@ -478,49 +467,6 @@ dio200_find_pci_board(struct pci_dev *pci_dev) ...@@ -478,49 +467,6 @@ dio200_find_pci_board(struct pci_dev *pci_dev)
return NULL; return NULL;
} }
/*
* This function looks for a PCI device matching the requested board name,
* bus and slot.
*/
static struct pci_dev *dio200_find_pci_dev(struct comedi_device *dev,
struct comedi_devconfig *it)
{
const struct dio200_board *thisboard = comedi_board(dev);
struct pci_dev *pci_dev = NULL;
int bus = it->options[0];
int slot = it->options[1];
for_each_pci_dev(pci_dev) {
if (bus || slot) {
if (bus != pci_dev->bus->number ||
slot != PCI_SLOT(pci_dev->devfn))
continue;
}
if (pci_dev->vendor != PCI_VENDOR_ID_AMPLICON)
continue;
if (thisboard->model == anypci_model) {
/* Wildcard board matches any supported PCI board. */
const struct dio200_board *foundboard;
foundboard = dio200_find_pci_board(pci_dev);
if (foundboard == NULL)
continue;
/* Replace wildcard board_ptr. */
dev->board_ptr = foundboard;
} else {
/* Match specific model name. */
if (pci_dev->device != thisboard->devid)
continue;
}
return pci_dev;
}
dev_err(dev->class_dev,
"No supported board found! (req. bus %d, slot %d)\n",
bus, slot);
return NULL;
}
/* /*
* This function checks and requests an I/O region, reporting an error * This function checks and requests an I/O region, reporting an error
* if there is a conflict. * if there is a conflict.
...@@ -1356,12 +1302,10 @@ static int dio200_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -1356,12 +1302,10 @@ static int dio200_attach(struct comedi_device *dev, struct comedi_devconfig *it)
return ret; return ret;
return dio200_common_attach(dev, iobase, irq, 0); return dio200_common_attach(dev, iobase, irq, 0);
} else if (is_pci_board(thisboard)) { } else if (is_pci_board(thisboard)) {
struct pci_dev *pci_dev; dev_err(dev->class_dev,
"Manual configuration of PCI board '%s' is not supported\n",
pci_dev = dio200_find_pci_dev(dev, it); thisboard->name);
if (!pci_dev) return -EIO;
return -EIO;
return dio200_pci_common_attach(dev, pci_dev);
} else { } else {
dev_err(dev->class_dev, DIO200_DRIVER_NAME dev_err(dev->class_dev, DIO200_DRIVER_NAME
": BUG! cannot determine board type!\n"); ": BUG! cannot determine board type!\n");
......
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