Commit 1f021e1f authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

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: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 309231d7
...@@ -27,6 +27,42 @@ ...@@ -27,6 +27,42 @@
#include "comedidev.h" #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_pcmcia_driver_register() - Register a comedi PCMCIA driver.
* @comedi_driver: comedi_driver struct * @comedi_driver: comedi_driver struct
......
...@@ -465,6 +465,12 @@ static inline void comedi_pci_disable(struct pci_dev *dev) ...@@ -465,6 +465,12 @@ static inline void comedi_pci_disable(struct pci_dev *dev)
/* comedi_pcmcia.c - comedi PCMCIA driver specific functions */ /* comedi_pcmcia.c - comedi PCMCIA driver specific functions */
struct pcmcia_driver; struct pcmcia_driver;
struct pcmcia_device;
struct pcmcia_device *comedi_to_pcmcia_dev(struct comedi_device *);
int comedi_pcmcia_auto_config(struct pcmcia_device *, struct comedi_driver *);
void comedi_pcmcia_auto_unconfig(struct pcmcia_device *);
int comedi_pcmcia_driver_register(struct comedi_driver *, int comedi_pcmcia_driver_register(struct comedi_driver *,
struct pcmcia_driver *); struct pcmcia_driver *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment