Commit 807e65b0 authored by Ian Abbott's avatar Ian Abbott Committed by Greg Kroah-Hartman

staging: comedi/drivers: use auto_attach instead of attach_usb

Change the usbdux, usbduxfast and usbduxsigma drivers to use the new
`auto_attach()` method instead of the `attach_usb()` method.  I plan to
remove the `attach_usb()` and `attach_pci()` methods from `struct
comedi_driver` once nothing is using them.
Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5df28346
......@@ -2375,9 +2375,10 @@ static int usbdux_attach_common(struct comedi_device *dev,
return 0;
}
static int usbdux_attach_usb(struct comedi_device *dev,
struct usb_interface *uinterf)
static int usbdux_auto_attach(struct comedi_device *dev,
unsigned long context_unused)
{
struct usb_interface *uinterf = comedi_to_usb_interface(dev);
int ret;
struct usbduxsub *this_usbduxsub;
......@@ -2387,11 +2388,11 @@ static int usbdux_attach_usb(struct comedi_device *dev,
this_usbduxsub = usb_get_intfdata(uinterf);
if (!this_usbduxsub || !this_usbduxsub->probed) {
dev_err(dev->class_dev,
"usbdux: error: attach_usb failed, not connected\n");
"usbdux: error: auto_attach failed, not connected\n");
ret = -ENODEV;
} else if (this_usbduxsub->attached) {
dev_err(dev->class_dev,
"error: attach_usb failed, already attached\n");
"error: auto_attach failed, already attached\n");
ret = -ENODEV;
} else
ret = usbdux_attach_common(dev, this_usbduxsub);
......@@ -2415,7 +2416,7 @@ static void usbdux_detach(struct comedi_device *dev)
static struct comedi_driver usbdux_driver = {
.driver_name = "usbdux",
.module = THIS_MODULE,
.attach_usb = usbdux_attach_usb,
.auto_attach = usbdux_auto_attach,
.detach = usbdux_detach,
};
......
......@@ -1444,9 +1444,10 @@ static int usbduxfast_attach_common(struct comedi_device *dev,
return 0;
}
static int usbduxfast_attach_usb(struct comedi_device *dev,
struct usb_interface *uinterf)
static int usbduxfast_auto_attach(struct comedi_device *dev,
unsigned long context_unused)
{
struct usb_interface *uinterf = comedi_to_usb_interface(dev);
int ret;
struct usbduxfastsub_s *udfs;
......@@ -1455,11 +1456,11 @@ static int usbduxfast_attach_usb(struct comedi_device *dev,
udfs = usb_get_intfdata(uinterf);
if (!udfs || !udfs->probed) {
dev_err(dev->class_dev,
"usbduxfast: error: attach_usb failed, not connected\n");
"usbduxfast: error: auto_attach failed, not connected\n");
ret = -ENODEV;
} else if (udfs->attached) {
dev_err(dev->class_dev,
"usbduxfast: error: attach_usb failed, already attached\n");
"usbduxfast: error: auto_attach failed, already attached\n");
ret = -ENODEV;
} else
ret = usbduxfast_attach_common(dev, udfs);
......@@ -1485,7 +1486,7 @@ static void usbduxfast_detach(struct comedi_device *dev)
static struct comedi_driver usbduxfast_driver = {
.driver_name = "usbduxfast",
.module = THIS_MODULE,
.attach_usb = usbduxfast_attach_usb,
.auto_attach = usbduxfast_auto_attach,
.detach = usbduxfast_detach,
};
......
......@@ -2359,9 +2359,10 @@ static int usbduxsigma_attach_common(struct comedi_device *dev,
return 0;
}
static int usbduxsigma_attach_usb(struct comedi_device *dev,
struct usb_interface *uinterf)
static int usbduxsigma_auto_attach(struct comedi_device *dev,
unsigned long context_unused)
{
struct usb_interface *uinterf = comedi_to_usb_interface(dev);
int ret;
struct usbduxsub *uds;
......@@ -2370,11 +2371,11 @@ static int usbduxsigma_attach_usb(struct comedi_device *dev,
uds = usb_get_intfdata(uinterf);
if (!uds || !uds->probed) {
dev_err(dev->class_dev,
"usbduxsigma: error: attach_usb failed, not connected\n");
"usbduxsigma: error: auto_attach failed, not connected\n");
ret = -ENODEV;
} else if (uds->attached) {
dev_err(dev->class_dev,
"usbduxsigma: error: attach_usb failed, already attached\n");
"usbduxsigma: error: auto_attach failed, already attached\n");
ret = -ENODEV;
} else
ret = usbduxsigma_attach_common(dev, uds);
......@@ -2398,7 +2399,7 @@ static void usbduxsigma_detach(struct comedi_device *dev)
static struct comedi_driver usbduxsigma_driver = {
.driver_name = "usbduxsigma",
.module = THIS_MODULE,
.attach_usb = usbduxsigma_attach_usb,
.auto_attach = usbduxsigma_auto_attach,
.detach = usbduxsigma_detach,
};
......
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