diff options
-rw-r--r-- | drivers/staging/comedi/drivers/ni_daq_dio24.c | 25 |
1 files 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. | |||
45 | 45 | ||
46 | #include "8255.h" | 46 | #include "8255.h" |
47 | 47 | ||
48 | static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev, | ||
49 | void *priv_data) | ||
50 | { | ||
51 | if (p_dev->config_index == 0) | ||
52 | return -EINVAL; | ||
53 | |||
54 | return pcmcia_request_io(p_dev); | ||
55 | } | ||
56 | |||
57 | static int dio24_auto_attach(struct comedi_device *dev, | 48 | static int dio24_auto_attach(struct comedi_device *dev, |
58 | unsigned long context) | 49 | unsigned long context) |
59 | { | 50 | { |
@@ -63,15 +54,8 @@ static int dio24_auto_attach(struct comedi_device *dev, | |||
63 | 54 | ||
64 | dev->board_name = dev->driver->driver_name; | 55 | dev->board_name = dev->driver->driver_name; |
65 | 56 | ||
66 | link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_AUDIO | | 57 | link->config_flags |= CONF_AUTO_SET_IO; |
67 | CONF_AUTO_SET_IO; | 58 | ret = comedi_pcmcia_enable(dev); |
68 | |||
69 | ret = pcmcia_loop_config(link, dio24_pcmcia_config_loop, NULL); | ||
70 | if (ret) | ||
71 | return ret; | ||
72 | |||
73 | ret = pcmcia_enable_device(link); | ||
74 | if (ret) | ||
75 | return ret; | 59 | return ret; |
76 | dev->iobase = link->resource[0]->start; | 60 | dev->iobase = link->resource[0]->start; |
77 | 61 | ||
@@ -90,12 +74,9 @@ static int dio24_auto_attach(struct comedi_device *dev, | |||
90 | 74 | ||
91 | static void dio24_detach(struct comedi_device *dev) | 75 | static void dio24_detach(struct comedi_device *dev) |
92 | { | 76 | { |
93 | struct pcmcia_device *link = comedi_to_pcmcia_dev(dev); | ||
94 | |||
95 | if (dev->subdevices) | 77 | if (dev->subdevices) |
96 | subdev_8255_cleanup(dev, &dev->subdevices[0]); | 78 | subdev_8255_cleanup(dev, &dev->subdevices[0]); |
97 | if (dev->iobase) | 79 | comedi_pcmcia_disable(dev); |
98 | pcmcia_disable_device(link); | ||
99 | } | 80 | } |
100 | 81 | ||
101 | static struct comedi_driver driver_dio24 = { | 82 | static struct comedi_driver driver_dio24 = { |