summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/comedidev.h
diff options
context:
space:
mode:
authorH Hartley Sweeten <hartleys@visionengravers.com>2012-07-19 17:39:33 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-19 23:19:39 (GMT)
commitddb01367b85df2c4c773bde047e5b04b6de1835b (patch)
tree5a8155b7421792c9027793918e0691985acbf16a /drivers/staging/comedi/comedidev.h
parent289a64295c9ae897c18302c15abd8f0464e8c6cb (diff)
downloadlinux-fsl-qoriq-ddb01367b85df2c4c773bde047e5b04b6de1835b.tar.xz
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>
Diffstat (limited to 'drivers/staging/comedi/comedidev.h')
-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 de8c99c..f713783 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);