Commit 5cd8e852 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: ni_mio_cs: use comedi_pcmcia_{enable, disable}

Use the comedi_pcmcia_{enable,disable} helpers to enable/disable
the PCMCIA device.

This driver uses a local (*conf_check) to check the pcmcia_device
configuration.
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 a3ac9519
...@@ -251,20 +251,15 @@ static int mio_cs_auto_attach(struct comedi_device *dev, ...@@ -251,20 +251,15 @@ static int mio_cs_auto_attach(struct comedi_device *dev,
dev->board_ptr = board; dev->board_ptr = board;
dev->board_name = board->name; dev->board_name = board->name;
link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO; link->config_flags |= CONF_AUTO_SET_IO | CONF_ENABLE_IRQ;
ret = comedi_pcmcia_enable(dev, mio_pcmcia_config_loop);
ret = pcmcia_loop_config(link, mio_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, ni_E_interrupt, NI_E_IRQ_FLAGS, ret = request_irq(link->irq, ni_E_interrupt, NI_E_IRQ_FLAGS,
dev->board_name, dev); dev->board_name, dev);
if (ret < 0) if (ret < 0)
...@@ -286,13 +281,10 @@ static int mio_cs_auto_attach(struct comedi_device *dev, ...@@ -286,13 +281,10 @@ static int mio_cs_auto_attach(struct comedi_device *dev,
static void mio_cs_detach(struct comedi_device *dev) static void mio_cs_detach(struct comedi_device *dev)
{ {
struct pcmcia_device *link = comedi_to_pcmcia_dev(dev);
mio_common_detach(dev); mio_common_detach(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_ni_mio_cs = { static struct comedi_driver driver_ni_mio_cs = {
......
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