Commit 9e29ce10 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

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: 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 ddb2d0a0
...@@ -397,15 +397,6 @@ static const void *das16cs_find_boardinfo(struct comedi_device *dev, ...@@ -397,15 +397,6 @@ static const void *das16cs_find_boardinfo(struct comedi_device *dev,
return NULL; 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, static int das16cs_auto_attach(struct comedi_device *dev,
unsigned long context) unsigned long context)
{ {
...@@ -421,21 +412,15 @@ static int das16cs_auto_attach(struct comedi_device *dev, ...@@ -421,21 +412,15 @@ static int das16cs_auto_attach(struct comedi_device *dev,
dev->board_ptr = board; dev->board_ptr = board;
dev->board_name = board->name; dev->board_name = board->name;
/* Do we need to allocate an interrupt? */ link->config_flags |= CONF_AUTO_SET_IO | CONF_ENABLE_IRQ;
link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO; ret = comedi_pcmcia_enable(dev);
ret = pcmcia_loop_config(link, das16cs_pcmcia_config_loop, NULL);
if (ret) if (ret)
return ret; return ret;
dev->iobase = link->resource[0]->start;
if (!link->irq) if (!link->irq)
return -EINVAL; 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, ret = request_irq(link->irq, das16cs_interrupt, IRQF_SHARED,
dev->board_name, dev); dev->board_name, dev);
if (ret < 0) if (ret < 0)
...@@ -497,12 +482,9 @@ static int das16cs_auto_attach(struct comedi_device *dev, ...@@ -497,12 +482,9 @@ static int das16cs_auto_attach(struct comedi_device *dev,
static void das16cs_detach(struct comedi_device *dev) static void das16cs_detach(struct comedi_device *dev)
{ {
struct pcmcia_device *link = comedi_to_pcmcia_dev(dev);
if (dev->irq) if (dev->irq)
free_irq(dev->irq, dev); free_irq(dev->irq, dev);
if (dev->iobase) comedi_pcmcia_disable(dev);
pcmcia_disable_device(link);
} }
static struct comedi_driver driver_das16cs = { static struct comedi_driver driver_das16cs = {
......
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