diff options
author | H Hartley Sweeten | 2013-02-05 18:15:42 -0700 |
---|---|---|
committer | Greg Kroah-Hartman | 2013-02-05 18:16:19 -0800 |
commit | 4f60f6b69c7741fe97e40f4d5210968162f8b7ad (patch) | |
tree | cd01f620c2ec96d2d85bfa7240f9aac1d83a6e65 | |
parent | 573a964882065f9b2cb71db8a225ba067b4b5b7a (diff) |
staging: comedi: ni_labpc_cs: use comedi_pcmcia_{enable,disable}
Use the comedi_pcmcia_{enable,disable} helpers to enable/disable
the PCMCIA device.
This driver is not an audio device, remove 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>
-rw-r--r-- | drivers/staging/comedi/drivers/ni_labpc_cs.c | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/drivers/staging/comedi/drivers/ni_labpc_cs.c b/drivers/staging/comedi/drivers/ni_labpc_cs.c index d23977591f58..1c55de35e874 100644 --- a/drivers/staging/comedi/drivers/ni_labpc_cs.c +++ b/drivers/staging/comedi/drivers/ni_labpc_cs.c @@ -87,15 +87,6 @@ static const struct labpc_board_struct labpc_cs_boards[] = { }, }; -static int labpc_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 labpc_auto_attach(struct comedi_device *dev, unsigned long context) { @@ -106,21 +97,16 @@ static int labpc_auto_attach(struct comedi_device *dev, /* The ni_labpc driver needs the board_ptr */ dev->board_ptr = &labpc_cs_boards[0]; - link->config_flags |= CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ | - CONF_AUTO_AUDIO | CONF_AUTO_SET_IO; - - ret = pcmcia_loop_config(link, labpc_pcmcia_config_loop, NULL); + link->config_flags |= CONF_AUTO_SET_IO | + CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_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; - devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL); if (!devpriv) return -ENOMEM; @@ -131,11 +117,8 @@ static int labpc_auto_attach(struct comedi_device *dev, static void labpc_detach(struct comedi_device *dev) { - struct pcmcia_device *link = comedi_to_pcmcia_dev(dev); - labpc_common_detach(dev); - if (dev->iobase) - pcmcia_disable_device(link); + comedi_pcmcia_disable(dev); } static struct comedi_driver driver_labpc_cs = { |