summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/comedidev.h
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2012-10-27 20:44:16 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-29 22:02:08 (GMT)
commit0a577b823d0202b94eeef0e6b2b5653527fd6134 (patch)
treed3f201a351fd9f0700fac5bf716210418fcf6c20 /drivers/staging/comedi/comedidev.h
parentd5121914a22c22d849abb57d086fe408c9ca2c0c (diff)
downloadlinux-fsl-qoriq-0a577b823d0202b94eeef0e6b2b5653527fd6134.tar.xz
staging: comedi: add comedi to usb interface helper
Add inline helper function `comedi_to_usb_interface()` to get the pointer to `struct usb_interface` associated with the comedi device. This pointer is set by the call to `comedi_usb_auto_config()`. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/comedidev.h')
-rw-r--r--drivers/staging/comedi/comedidev.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h
index 2b884a6..4ac2de4 100644
--- a/drivers/staging/comedi/comedidev.h
+++ b/drivers/staging/comedi/comedidev.h
@@ -41,6 +41,7 @@
#include <linux/io.h>
#include <linux/timer.h>
#include <linux/pci.h>
+#include <linux/usb.h>
#include "comedi.h"
@@ -193,8 +194,6 @@ struct comedi_async {
unsigned int x);
};
-struct usb_interface;
-
struct comedi_driver {
struct comedi_driver *next;
@@ -457,6 +456,12 @@ static inline struct pci_dev *comedi_to_pci_dev(struct comedi_device *dev)
return dev->hw_dev ? to_pci_dev(dev->hw_dev) : NULL;
}
+static inline struct usb_interface *
+comedi_to_usb_interface(struct comedi_device *dev)
+{
+ return dev->hw_dev ? to_usb_interface(dev->hw_dev) : NULL;
+}
+
int comedi_buf_put(struct comedi_async *async, short x);
int comedi_buf_get(struct comedi_async *async, short *x);