2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-16 09:13:55 +08:00

staging: comedi: introduce comedi_to_usb_dev()

Introduce a helper function to get a usb_device pointer from a
comedi_device pointer.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
H Hartley Sweeten 2013-05-20 14:20:02 -07:00 committed by Greg Kroah-Hartman
parent 4422a6c14d
commit 61dd149b10
2 changed files with 13 additions and 0 deletions

View File

@ -30,6 +30,18 @@ struct usb_interface *comedi_to_usb_interface(struct comedi_device *dev)
}
EXPORT_SYMBOL_GPL(comedi_to_usb_interface);
/**
* comedi_to_usb_dev() - comedi_device pointer to usb_device pointer.
* @dev: comedi_device struct
*/
struct usb_device *comedi_to_usb_dev(struct comedi_device *dev)
{
struct usb_interface *intf = comedi_to_usb_interface(dev);
return intf ? interface_to_usbdev(intf) : NULL;
}
EXPORT_SYMBOL_GPL(comedi_to_usb_dev);
/**
* comedi_usb_auto_config() - Configure/probe a comedi USB driver.
* @intf: usb_interface struct

View File

@ -491,6 +491,7 @@ struct usb_driver;
struct usb_interface;
struct usb_interface *comedi_to_usb_interface(struct comedi_device *);
struct usb_device *comedi_to_usb_dev(struct comedi_device *);
int comedi_usb_auto_config(struct usb_interface *, struct comedi_driver *,
unsigned long context);