Skip to content

Commit

Permalink
staging: comedi: add comedi to usb interface helper
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ian Abbott authored and Greg Kroah-Hartman committed Oct 29, 2012
1 parent d512191 commit 0a577b8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/staging/comedi/comedidev.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <linux/io.h>
#include <linux/timer.h>
#include <linux/pci.h>
#include <linux/usb.h>

#include "comedi.h"

Expand Down Expand Up @@ -193,8 +194,6 @@ struct comedi_async {
unsigned int x);
};

struct usb_interface;

struct comedi_driver {
struct comedi_driver *next;

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 0a577b8

Please sign in to comment.