diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2013-01-30 22:23:06 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-31 09:40:41 (GMT) |
commit | 1f021e1f3b187586e457b4584d0e5f0f5ca5fa15 (patch) | |
tree | 5ca3e7412f997b445e022686c271a377f537c1e0 /drivers/staging/comedi/comedi_pcmcia.c | |
parent | 309231d7a610554b02084ff7b465e43ef383a3bc (diff) | |
download | linux-1f021e1f3b187586e457b4584d0e5f0f5ca5fa15.tar.xz |
staging: comedi: allow pcmcia drivers to auto attach
Introduce some helper functions to allow converting the comedi
pcmcia drivers to the comedi auto_attach mechanism.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/comedi_pcmcia.c')
-rw-r--r-- | drivers/staging/comedi/comedi_pcmcia.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/staging/comedi/comedi_pcmcia.c b/drivers/staging/comedi/comedi_pcmcia.c index 8522945..f10bcc5 100644 --- a/drivers/staging/comedi/comedi_pcmcia.c +++ b/drivers/staging/comedi/comedi_pcmcia.c @@ -28,6 +28,42 @@ #include "comedidev.h" /** + * comedi_to_pcmcia_dev() - comedi_device pointer to pcmcia_device pointer. + * @dev: comedi_device struct + */ +struct pcmcia_device *comedi_to_pcmcia_dev(struct comedi_device *dev) +{ + return dev->hw_dev ? to_pcmcia_dev(dev->hw_dev) : NULL; +} +EXPORT_SYMBOL_GPL(comedi_to_pcmcia_dev); + +/** + * comedi_pcmcia_auto_config() - Configure/probe a comedi PCMCIA driver. + * @link: pcmcia_device struct + * @driver: comedi_driver struct + * + * Typically called from the pcmcia_driver (*probe) function. + */ +int comedi_pcmcia_auto_config(struct pcmcia_device *link, + struct comedi_driver *driver) +{ + return comedi_auto_config(&link->dev, driver, 0); +} +EXPORT_SYMBOL_GPL(comedi_pcmcia_auto_config); + +/** + * comedi_pcmcia_auto_unconfig() - Unconfigure/remove a comedi PCMCIA driver. + * @link: pcmcia_device struct + * + * Typically called from the pcmcia_driver (*remove) function. + */ +void comedi_pcmcia_auto_unconfig(struct pcmcia_device *link) +{ + comedi_auto_unconfig(&link->dev); +} +EXPORT_SYMBOL_GPL(comedi_pcmcia_auto_unconfig); + +/** * comedi_pcmcia_driver_register() - Register a comedi PCMCIA driver. * @comedi_driver: comedi_driver struct * @pcmcia_driver: pcmcia_driver struct |