diff options
author | Ian Abbott <abbotti@mev.co.uk> | 2012-11-14 13:10:40 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-11-15 00:25:48 (GMT) |
commit | 581a7ddec13d8f08b308c4764090bf57b0254f6f (patch) | |
tree | dc62d61aa515d7608013973f8aeb0d3d92c348f5 /drivers/staging/comedi/comedidev.h | |
parent | ddbd029903d29ec9a5aceb82d4b0c4a7468d1984 (diff) | |
download | linux-fsl-qoriq-581a7ddec13d8f08b308c4764090bf57b0254f6f.tar.xz |
staging: comedi: use inlines for PCI/USB auto config
Apart from the somewhat unnecessary `BUG_ON()` calls,
`comedi_pci_auto_config()` and `comedi_usb_auto_config()` are just
one-line wrappers around `comedi_auto_config()`, and
`comedi_pci_auto_unconfig()` and `comedi_usb_auto_unconfig()` are just
one-line wrappers around `comedi_auto_unconfig()`. Convert them to
inline functions and remove the `BUG_ON()` calls.
Signed-off-by: Ian Abbott <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.h | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h index ce6ab93..692e1e6 100644 --- a/drivers/staging/comedi/comedidev.h +++ b/drivers/staging/comedi/comedidev.h @@ -517,11 +517,27 @@ void comedi_free_subdevice_minor(struct comedi_subdevice *s); int comedi_auto_config(struct device *hardware_device, struct comedi_driver *driver, unsigned long context); void comedi_auto_unconfig(struct device *hardware_device); -int comedi_pci_auto_config(struct pci_dev *pcidev, - struct comedi_driver *driver); -void comedi_pci_auto_unconfig(struct pci_dev *pcidev); -int comedi_usb_auto_config(struct usb_interface *intf, - struct comedi_driver *driver); -void comedi_usb_auto_unconfig(struct usb_interface *intf); + +static inline int comedi_pci_auto_config(struct pci_dev *pcidev, + struct comedi_driver *driver) +{ + return comedi_auto_config(&pcidev->dev, driver, 0); +} + +static inline void comedi_pci_auto_unconfig(struct pci_dev *pcidev) +{ + comedi_auto_unconfig(&pcidev->dev); +} + +static inline int comedi_usb_auto_config(struct usb_interface *intf, + struct comedi_driver *driver) +{ + return comedi_auto_config(&intf->dev, driver, 0); +} + +static inline void comedi_usb_auto_unconfig(struct usb_interface *intf) +{ + comedi_auto_unconfig(&intf->dev); +} #endif /* _COMEDIDEV_H */ |