From ddb01367b85df2c4c773bde047e5b04b6de1835b Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Thu, 19 Jul 2012 10:39:33 -0700 Subject: [PATCH] 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 Cc: Ian Abbot Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/comedidev.h | 5 +++++ 1 file changed, 5 insertions(+) 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); -- 2.39.2