On Mon, Apr 02, 2012 at 11:48:54AM +0100, Ian Abbott wrote:On 2012-03-19 23:26, Greg KH wrote:On Mon, Mar 19, 2012 at 03:46:49PM -0700, Gerard Snitselaar wrote:I looked at this a bit more. It looks like they lose visibility to the
pci_dev structure.
*_probe()
comedi_pci_auto_config() pci_dev
comedi_auto_config() pci_dev->dev
comedi_device_attach() ??
driv->attach() ??<= iterate through pci devices.
Most of the examples I have looked at so far use for_each_pci_dev() to
find the device, and s626 shortcuts it a bit by directly making calls
to pci_get_subsys() with specific ids. They all verify they have the
right device by checking the bus and slot that are grabbed from the
pci_dev in comedi_pci_auto_config() and passed down.
Ugh, surely there's a way to keep the pci dev through the
comedi_device_attach() call, right?
comedi_device_attach() is also called for the COMEDI_DEVCONFIG ioctl
for "manually" configuring a comedi device, and that has no idea
about struct pci_dev, etc.
I recently posted a series of patches that allows lower-level comedi
drivers to supply separate hooks for auto-configuring PCI devices or
USB devices without abusing the old "manual configuration" code
paths, see <http://driverdev.linuxdriverproject.org/pipermail/devel/2012-March/025331.html>.
The old loop that searches the PCI bus is still needed for the
"manual configuration" code path.
So, now that I've applied your patches, this patch isn't needed anymore,
right? Or should it be reworked to use the new interfaces?