diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2013-02-06 01:16:07 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-02-06 02:16:19 (GMT) |
commit | a3ac95195b020a0a8fa2a9b0649145324ba64c83 (patch) | |
tree | e5a234df0486da085ac2945c5a0c7aeccebffbcf /drivers/staging/comedi/comedi_pcmcia.c | |
parent | 4f60f6b69c7741fe97e40f4d5210968162f8b7ad (diff) | |
download | linux-a3ac95195b020a0a8fa2a9b0649145324ba64c83.tar.xz |
staging: comedi: comedi_pcmcia: allow drivers to use a custom conf_check()
Allow comedi pcmcia drivers to use a custom conf_check() when calling
comedi_pcmcia_enable() to enable the pcmcia device. If a conf_check()
is not passed the internal comedi_pcmcia_conf_check() will be used.
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 | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/staging/comedi/comedi_pcmcia.c b/drivers/staging/comedi/comedi_pcmcia.c index 925f128..453ff3b 100644 --- a/drivers/staging/comedi/comedi_pcmcia.c +++ b/drivers/staging/comedi/comedi_pcmcia.c @@ -49,12 +49,14 @@ static int comedi_pcmcia_conf_check(struct pcmcia_device *link, /** * comedi_pcmcia_enable() - Request the regions and enable the PCMCIA device. * @dev: comedi_device struct + * @conf_check: optional callback to check the pcmcia_device configuration * * The comedi PCMCIA driver needs to set the link->config_flags, as * appropriate for that driver, before calling this function in order * to allow pcmcia_loop_config() to do its internal autoconfiguration. */ -int comedi_pcmcia_enable(struct comedi_device *dev) +int comedi_pcmcia_enable(struct comedi_device *dev, + int (*conf_check)(struct pcmcia_device *, void *)) { struct pcmcia_device *link = comedi_to_pcmcia_dev(dev); int ret; @@ -62,7 +64,10 @@ int comedi_pcmcia_enable(struct comedi_device *dev) if (!link) return -ENODEV; - ret = pcmcia_loop_config(link, comedi_pcmcia_conf_check, NULL); + if (!conf_check) + conf_check = comedi_pcmcia_conf_check; + + ret = pcmcia_loop_config(link, conf_check, NULL); if (ret) return ret; |