summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2013-02-04 14:20:08 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-02-04 14:47:18 -0800
commit9e29ce104a83d801c7fc6bc57c189608195e831e (patch)
tree6917d58e0560667bb4d350125c8436704826f872 /drivers/staging
parentddb2d0a0185583b268dfe0a32e2f70ee2f118bd0 (diff)
staging: comedi: cb_das16_cs: use comedi_pcmcia_{enable, disable}
Use the comedi_pcmcia_{enable,disable} helpers to enable/disable the PCMCIA device. 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')
-rw-r--r--drivers/staging/comedi/drivers/cb_das16_cs.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/drivers/staging/comedi/drivers/cb_das16_cs.c b/drivers/staging/comedi/drivers/cb_das16_cs.c
index efff05954133..876372678256 100644
--- a/drivers/staging/comedi/drivers/cb_das16_cs.c
+++ b/drivers/staging/comedi/drivers/cb_das16_cs.c
@@ -397,15 +397,6 @@ static const void *das16cs_find_boardinfo(struct comedi_device *dev,
return NULL;
}
-static int das16cs_pcmcia_config_loop(struct pcmcia_device *p_dev,
- void *priv_data)
-{
- if (p_dev->config_index == 0)
- return -EINVAL;
-
- return pcmcia_request_io(p_dev);
-}
-
static int das16cs_auto_attach(struct comedi_device *dev,
unsigned long context)
{
@@ -421,21 +412,15 @@ static int das16cs_auto_attach(struct comedi_device *dev,
dev->board_ptr = board;
dev->board_name = board->name;
- /* Do we need to allocate an interrupt? */
- link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
-
- ret = pcmcia_loop_config(link, das16cs_pcmcia_config_loop, NULL);
+ link->config_flags |= CONF_AUTO_SET_IO | CONF_ENABLE_IRQ;
+ ret = comedi_pcmcia_enable(dev);
if (ret)
return ret;
+ dev->iobase = link->resource[0]->start;
if (!link->irq)
return -EINVAL;
- ret = pcmcia_enable_device(link);
- if (ret)
- return ret;
- dev->iobase = link->resource[0]->start;
-
ret = request_irq(link->irq, das16cs_interrupt, IRQF_SHARED,
dev->board_name, dev);
if (ret < 0)
@@ -497,12 +482,9 @@ static int das16cs_auto_attach(struct comedi_device *dev,
static void das16cs_detach(struct comedi_device *dev)
{
- struct pcmcia_device *link = comedi_to_pcmcia_dev(dev);
-
if (dev->irq)
free_irq(dev->irq, dev);
- if (dev->iobase)
- pcmcia_disable_device(link);
+ comedi_pcmcia_disable(dev);
}
static struct comedi_driver driver_das16cs = {