None of the low-level comedi drivers using the "mite" module currently use the comedi `attach_pci` hook for auto-configuration of supported PCI devices (though auto-configuration is currently supported using the `attach` hook). They also rely on a list of National Instruments PCI devices populated when the "mite" module is loaded. Add the `attach_pci` hook to these drivers and disable manual attachment of supported PCI devices via the `attach` hook used by the `COMEDI_DEVCONFIG` ioctl. The "ni_labpc" driver still needs the `attach` hook to support ISA boards, so just make it log an error for PCI devices. The `attach` hook is not needed by the "ni_6527", "ni_65xx", "ni_660x", "ni_670x", "ni_pcidio" and "ni_pcimio" drivers, so remove it from those drivers. The "ni_pcidio" driver needs to load firmware for the PCI-6534 card. That used to be possible only by using the `COMEDI_DEVCONFIG` ioctl to call the `attach` hook, including the firmware blobs in the ioctl data. That is no longer supported. Instead, the `attach_pci` hook uses `request_firmware()` to get the firmware blobs. Change the drivers to allocate a `struct mite_struct` dynamically in the `attach_pci` hook instead of searching the list populated when the "mite" module was loaded. Change the "mite" module to remove this list altogether. All these drivers need further work, but this is hopefully a step in the right direction! Patches 1 to 5: tidy up the "ni_6527" driver a little bit and replace the `attach` hook with `attach_pci`. Patches 6 to 9: ditto for the "ni_65xx" driver. Patches 10 to 12: ditto for the "ni_660x" driver. Patch 13: ditto for the "ni_670x" driver. Patches 14 to 17: tidy up the "ni_labpc" driver a little bit, add the `attach_pci` hook and remove "manual" configuration of PCI devices. Patches 18 to 20: tidy up the "ni_pcidio" driver a little bit, use `request_firmware()` to fetch the firmware blobs, and replace the `attach` hook with `attach_pci`. Patch 21: remove an unused parameter from `ni_E_init()` in "ni_mio_common.c" used by the "ni_pcimio" driver and a couple of others. Patches 22 to 23: tidy up the "ni_pcimio" driver a little bit and replace the `attach` hook with `attach_pci`. Patches 24 to 27: tidy up the "mite" module a little bit and export a couple of previously static inline functions. Patch 28: add "mite" functions to allow drivers to allocate and free `struct mite_struct` dynamically. Patch 29: change the "ni_6527" driver to allocate the "mite" stuff dynamically. Patch 30: ditto for the "ni_65xx" driver. Patch 31: ditto for the "ni_660x" driver. Patch 32: ditto for the "ni_670x" driver. Patch 33: remove a spurious `free_irq()` call in the "ni_670x" driver. Patch 34: change the "ni_labpc" driver to allocate the "mite" stuff dynamically. Patch 35: ditto for the "ni_pcidio" driver. Patch 36: ditto for the "ni_pcimio" driver. Patch 37: remove list of "mite" devices from the "mite" module. Patch 38: change "mite" module to use `module_init()` and `module_exit()`. drivers/staging/comedi/drivers/mite.c | 283 ++++++++++++------------- drivers/staging/comedi/drivers/mite.h | 66 ++---- drivers/staging/comedi/drivers/ni_6527.c | 126 +++++------ drivers/staging/comedi/drivers/ni_65xx.c | 127 ++++------- drivers/staging/comedi/drivers/ni_660x.c | 121 ++++------- drivers/staging/comedi/drivers/ni_670x.c | 56 ++--- drivers/staging/comedi/drivers/ni_atmio.c | 2 +- drivers/staging/comedi/drivers/ni_labpc.c | 251 +++++++++------------- drivers/staging/comedi/drivers/ni_mio_common.c | 2 +- drivers/staging/comedi/drivers/ni_mio_cs.c | 2 +- drivers/staging/comedi/drivers/ni_pcidio.c | 201 +++++++++--------- drivers/staging/comedi/drivers/ni_pcimio.c | 70 +++--- 12 files changed, 539 insertions(+), 768 deletions(-) _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/devel