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

staging: comedi: don't call attach_usb handler

All the Comedi drivers that call `comedi_usb_auto_config()` have
replaced the `attach_usb()` handler in their `struct comedi_driver` with
a `auto_attach()` handler, so there is no need to check for the
existence of the `attach_usb()` handler any more.  Remove this check and
the code that calls it.
Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a692e974
...@@ -996,27 +996,11 @@ EXPORT_SYMBOL_GPL(comedi_pci_driver_unregister); ...@@ -996,27 +996,11 @@ EXPORT_SYMBOL_GPL(comedi_pci_driver_unregister);
#if IS_ENABLED(CONFIG_USB) #if IS_ENABLED(CONFIG_USB)
static int comedi_usb_attach_wrapper(struct comedi_device *dev,
unsigned long context)
{
return dev->driver->attach_usb(dev, (struct usb_interface *)context);
}
static int comedi_new_usb_auto_config(struct usb_interface *intf,
struct comedi_driver *driver)
{
return comedi_auto_config_helper(&intf->dev, driver,
comedi_usb_attach_wrapper,
(unsigned long)intf);
}
int comedi_usb_auto_config(struct usb_interface *intf, int comedi_usb_auto_config(struct usb_interface *intf,
struct comedi_driver *driver) struct comedi_driver *driver)
{ {
BUG_ON(intf == NULL); BUG_ON(intf == NULL);
if (driver->attach_usb) if (driver->auto_attach)
return comedi_new_usb_auto_config(intf, driver);
else if (driver->auto_attach)
return comedi_auto_config(&intf->dev, driver, 0); return comedi_auto_config(&intf->dev, driver, 0);
else else
return -EINVAL; return -EINVAL;
......
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