The auto-configuration/auto-attach mechanism in Comedi used by most of the low-level PCI and USB Comedi hardware drivers currently uses separate hooks in `struct comedi_driver` for each bus type - `->attach_usb()` and `->attach_pci()`. I'd like to move away from that and use a single auto-attach hook, `->auto_attach()` and make it easy for an implementation of this hook in a low-level driver to get a pointer to the `struct pci_dev`, `struct usb_interface` or whatever device wrapper is relevant to the device being auto-attached to comedi. Also, the Comedi core exports nice wrapper functions for auto-attaching PCI or USB devices (`comedi_pci_auto_config()` and `comedi_usb_auto_config()`) along with functions for auto-detaching them, but there is currently no way to auto-attach devices on some arbitrary type of bus. Export functions `comedi_auto_config()` (different to the current static function of the same name) and `comedi_auto_unconfig()`) to allow this. Eventually, there will be nice wrapper functions for some more commonly used device types such as PCMCIA, but it should be easy enough to implement those as static inline wrappers around `comedi_auto_config()` and `comedi_auto_unconfig()`. This patch series only changes one PCI driver and one USB driver to use the new `auto_attach()` hook, but it will be easy enough to change the others. Once that is done, the `attach_pci()` and `attach_usb()` hooks can be removed from `struct comedi_driver`. PATCH 1) staging: comedi: avoid a put_device(), get_device() sequence PATCH 2) staging: comedi: always set hw_dev during auto-config PATCH 3) staging: comedi: change type of auto-config context PATCH 4) staging: comedi: rename old auto-config functions PATCH 5) staging: comedi: add generic auto-config functions PATCH 6) staging: comedi: support auto_attach() for PCI and USB PATCH 7) staging: comedi: add comedi to usb interface helper PATCH 8) staging: comedi: vmk80xx: use auto_attach() hook PATCH 9) staging: comedi: amplc_pci230: use auto_attach() hook drivers/staging/comedi/comedidev.h | 20 ++++++-- drivers/staging/comedi/drivers.c | 69 ++++++++++++++++++++------- drivers/staging/comedi/drivers/amplc_pci230.c | 7 +-- drivers/staging/comedi/drivers/vmk80xx.c | 7 +-- 4 files changed, 77 insertions(+), 26 deletions(-) _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/devel