summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH Hartley Sweeten <hartleys@visionengravers.com>2012-07-19 10:39:33 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-19 16:19:39 -0700
commitddb01367b85df2c4c773bde047e5b04b6de1835b (patch)
tree5a8155b7421792c9027793918e0691985acbf16a
parent289a64295c9ae897c18302c15abd8f0464e8c6cb (diff)
staging: comedi: comedidev.h: introduce comedi_to_pci_dev() helper
Introduce a wrapper for to_pci_dev() to allow the comedi_pci_drivers to store the pci_dev pointer in the comedi_device hw_dev variable and retrieve it easily. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbot <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/comedi/comedidev.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h
index de8c99c34070..f713783ef624 100644
--- a/drivers/staging/comedi/comedidev.h
+++ b/drivers/staging/comedi/comedidev.h
@@ -446,6 +446,11 @@ static inline void comedi_set_hw_dev(struct comedi_device *dev,
}
}
+static inline struct pci_dev *comedi_to_pci_dev(struct comedi_device *dev)
+{
+ return dev->hw_dev ? to_pci_dev(dev->hw_dev) : NULL;
+}
+
int comedi_buf_put(struct comedi_async *async, short x);
int comedi_buf_get(struct comedi_async *async, short *x);