Allow `comedi_pci_auto_config()` and `comedi_usb_auto_config()` to use
the new `auto_attach()` hook in the low-level driver's `struct
comedi_driver` if it is set and the `attach_pci()` or `attach_usb()`
hook (for PCI or USB respectively) is `NULL`.
Eventually, the `auto_attach()` hook will be the only way of
auto-configuring hardware devices as comedi devices and the bus-type
specific `attach_pci()` and `attach_usb()` hooks will be removed.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (driver->attach_pci)
return comedi_new_pci_auto_config(pcidev, driver);
+ else if (driver->auto_attach)
+ return comedi_auto_config(&pcidev->dev, driver, 0);
else
return comedi_old_pci_auto_config(pcidev, driver);
}
BUG_ON(intf == NULL);
if (driver->attach_usb)
return comedi_new_usb_auto_config(intf, driver);
+ else if (driver->auto_attach)
+ return comedi_auto_config(&intf->dev, driver, 0);
else
return comedi_old_usb_auto_config(intf, driver);
}