Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

H Hartley Sweeten and committed by
Greg Kroah-Hartman
61dd149b 4422a6c1

+13
+12
drivers/staging/comedi/comedi_usb.c
··· 31 31 EXPORT_SYMBOL_GPL(comedi_to_usb_interface); 32 32 33 33 /** 34 + * comedi_to_usb_dev() - comedi_device pointer to usb_device pointer. 35 + * @dev: comedi_device struct 36 + */ 37 + struct usb_device *comedi_to_usb_dev(struct comedi_device *dev) 38 + { 39 + struct usb_interface *intf = comedi_to_usb_interface(dev); 40 + 41 + return intf ? interface_to_usbdev(intf) : NULL; 42 + } 43 + EXPORT_SYMBOL_GPL(comedi_to_usb_dev); 44 + 45 + /** 34 46 * comedi_usb_auto_config() - Configure/probe a comedi USB driver. 35 47 * @intf: usb_interface struct 36 48 * @driver: comedi_driver struct
+1
drivers/staging/comedi/comedidev.h
··· 491 491 struct usb_interface; 492 492 493 493 struct usb_interface *comedi_to_usb_interface(struct comedi_device *); 494 + struct usb_device *comedi_to_usb_dev(struct comedi_device *); 494 495 495 496 int comedi_usb_auto_config(struct usb_interface *, struct comedi_driver *, 496 497 unsigned long context);