Skip to content

Commit

Permalink
staging: comedi: comedidev.h: introduce comedi_to_pci_dev() helper
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jul 19, 2012
1 parent 289a642 commit ddb0136
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/staging/comedi/comedidev.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit ddb0136

Please sign in to comment.