From 573a964882065f9b2cb71db8a225ba067b4b5b7a Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Tue, 5 Feb 2013 18:15:20 -0700 Subject: [PATCH] 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 Cc: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_daq_dio24.c | 25 +++---------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_daq_dio24.c b/drivers/staging/comedi/drivers/ni_daq_dio24.c index 53fd4d0f88df..edfbfb315122 100644 --- a/drivers/staging/comedi/drivers/ni_daq_dio24.c +++ b/drivers/staging/comedi/drivers/ni_daq_dio24.c @@ -45,15 +45,6 @@ the PCMCIA interface. #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, unsigned long context) { @@ -63,15 +54,8 @@ static int dio24_auto_attach(struct comedi_device *dev, dev->board_name = dev->driver->driver_name; - link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_AUDIO | - CONF_AUTO_SET_IO; - - ret = pcmcia_loop_config(link, dio24_pcmcia_config_loop, NULL); - if (ret) - return ret; - - ret = pcmcia_enable_device(link); - if (ret) + link->config_flags |= CONF_AUTO_SET_IO; + ret = comedi_pcmcia_enable(dev); return ret; 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) { - struct pcmcia_device *link = comedi_to_pcmcia_dev(dev); - if (dev->subdevices) subdev_8255_cleanup(dev, &dev->subdevices[0]); - if (dev->iobase) - pcmcia_disable_device(link); + comedi_pcmcia_disable(dev); } static struct comedi_driver driver_dio24 = { -- GitLab