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

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

This driver does not use interrupts and is not an audio device, remove
CONF_ENABLE_IRQ and CONF_AUTO_AUDIO from the link->config_flags.

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>
This commit is contained in:
H Hartley Sweeten 2013-02-05 18:15:20 -07:00 committed by Greg Kroah-Hartman
parent 66dbc7b1b0
commit 573a964882

View file

@ -45,15 +45,6 @@ the PCMCIA interface.
#include "8255.h" #include "8255.h"
static int dio24_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 dio24_auto_attach(struct comedi_device *dev, static int dio24_auto_attach(struct comedi_device *dev,
unsigned long context) unsigned long context)
{ {
@ -63,15 +54,8 @@ static int dio24_auto_attach(struct comedi_device *dev,
dev->board_name = dev->driver->driver_name; dev->board_name = dev->driver->driver_name;
link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_AUDIO | link->config_flags |= CONF_AUTO_SET_IO;
CONF_AUTO_SET_IO; ret = comedi_pcmcia_enable(dev);
ret = pcmcia_loop_config(link, dio24_pcmcia_config_loop, NULL);
if (ret)
return ret;
ret = pcmcia_enable_device(link);
if (ret)
return ret; return ret;
dev->iobase = link->resource[0]->start; dev->iobase = link->resource[0]->start;
@ -90,12 +74,9 @@ static int dio24_auto_attach(struct comedi_device *dev,
static void dio24_detach(struct comedi_device *dev) static void dio24_detach(struct comedi_device *dev)
{ {
struct pcmcia_device *link = comedi_to_pcmcia_dev(dev);
if (dev->subdevices) if (dev->subdevices)
subdev_8255_cleanup(dev, &dev->subdevices[0]); subdev_8255_cleanup(dev, &dev->subdevices[0]);
if (dev->iobase) comedi_pcmcia_disable(dev);
pcmcia_disable_device(link);
} }
static struct comedi_driver driver_dio24 = { static struct comedi_driver driver_dio24 = {