diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-06 15:25:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-06 15:25:06 -0400 |
commit | 1685e633b396b0f3dabbc9fa5d65dfefe6435250 (patch) | |
tree | ee83e26e2468ca1518a1b065c690159e12c8def9 /drivers/staging | |
parent | 1cfd2bda8c486ae0e7a8005354758ebb68172bca (diff) | |
parent | 127c03cdbad9bd5af5d7f33bd31a1015a90cb77f (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6:
pcmcia: avoid buffer overflow in pcmcia_setup_isa_irq
pcmcia: do not request windows if you don't need to
pcmcia: insert PCMCIA device resources into resource tree
pcmcia: export resource information to sysfs
pcmcia: use struct resource for PCMCIA devices, part 2
pcmcia: remove memreq_t
pcmcia: move local definitions out of include/pcmcia/cs.h
pcmcia: do not use io_req_t when calling pcmcia_request_io()
pcmcia: do not use io_req_t after call to pcmcia_request_io()
pcmcia: use struct resource for PCMCIA devices
pcmcia: clean up cs.h
pcmcia: use pcmica_{read,write}_config_byte
pcmcia: remove cs_types.h
pcmcia: remove unused flag, simplify headers
pcmcia: remove obsolete CS_EVENT_ definitions
pcmcia: split up central event handler
pcmcia: simplify event callback
pcmcia: remove obsolete ioctl
Conflicts in:
- drivers/staging/comedi/drivers/*
- drivers/staging/wlags49_h2/wl_cs.c
due to dev_info_t and whitespace changes
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/comedi/drivers/cb_das16_cs.c | 47 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/das08_cs.c | 46 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/ni_daq_700.c | 72 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/ni_daq_dio24.c | 73 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/ni_labpc_cs.c | 73 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/ni_mio_cs.c | 19 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/quatech_daqp_cs.c | 49 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_cs.c | 11 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_internal.h | 1 |
9 files changed, 119 insertions, 272 deletions
diff --git a/drivers/staging/comedi/drivers/cb_das16_cs.c b/drivers/staging/comedi/drivers/cb_das16_cs.c index 6d893c65adc8..f8ede1182ccc 100644 --- a/drivers/staging/comedi/drivers/cb_das16_cs.c +++ b/drivers/staging/comedi/drivers/cb_das16_cs.c | |||
@@ -37,7 +37,6 @@ Status: experimental | |||
37 | #include <linux/delay.h> | 37 | #include <linux/delay.h> |
38 | #include <linux/pci.h> | 38 | #include <linux/pci.h> |
39 | 39 | ||
40 | #include <pcmcia/cs_types.h> | ||
41 | #include <pcmcia/cs.h> | 40 | #include <pcmcia/cs.h> |
42 | #include <pcmcia/cistpl.h> | 41 | #include <pcmcia/cistpl.h> |
43 | #include <pcmcia/ds.h> | 42 | #include <pcmcia/ds.h> |
@@ -171,7 +170,7 @@ static int das16cs_attach(struct comedi_device *dev, | |||
171 | if (!link) | 170 | if (!link) |
172 | return -EIO; | 171 | return -EIO; |
173 | 172 | ||
174 | dev->iobase = link->io.BasePort1; | 173 | dev->iobase = link->resource[0]->start;; |
175 | printk("I/O base=0x%04lx ", dev->iobase); | 174 | printk("I/O base=0x%04lx ", dev->iobase); |
176 | 175 | ||
177 | printk("fingerprint:\n"); | 176 | printk("fingerprint:\n"); |
@@ -662,14 +661,6 @@ static void das16cs_pcmcia_detach(struct pcmcia_device *); | |||
662 | less on other parts of the kernel. | 661 | less on other parts of the kernel. |
663 | */ | 662 | */ |
664 | 663 | ||
665 | /* | ||
666 | The dev_info variable is the "key" that is used to match up this | ||
667 | device driver with appropriate cards, through the card configuration | ||
668 | database. | ||
669 | */ | ||
670 | |||
671 | static dev_info_t dev_info = "cb_das16_cs"; | ||
672 | |||
673 | struct local_info_t { | 664 | struct local_info_t { |
674 | struct pcmcia_device *link; | 665 | struct pcmcia_device *link; |
675 | int stop; | 666 | int stop; |
@@ -736,24 +727,22 @@ static int das16cs_pcmcia_config_loop(struct pcmcia_device *p_dev, | |||
736 | p_dev->conf.Attributes |= CONF_ENABLE_IRQ; | 727 | p_dev->conf.Attributes |= CONF_ENABLE_IRQ; |
737 | 728 | ||
738 | /* IO window settings */ | 729 | /* IO window settings */ |
739 | p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; | 730 | p_dev->resource[0]->end = p_dev->resource[1]->end = 0; |
740 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { | 731 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { |
741 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; | 732 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; |
742 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 733 | p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK; |
743 | if (!(io->flags & CISTPL_IO_8BIT)) | 734 | p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; |
744 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; | 735 | p_dev->resource[0]->flags |= |
745 | if (!(io->flags & CISTPL_IO_16BIT)) | 736 | pcmcia_io_cfg_data_width(io->flags); |
746 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | 737 | p_dev->resource[0]->start = io->win[0].base; |
747 | p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; | 738 | p_dev->resource[0]->end = io->win[0].len; |
748 | p_dev->io.BasePort1 = io->win[0].base; | ||
749 | p_dev->io.NumPorts1 = io->win[0].len; | ||
750 | if (io->nwin > 1) { | 739 | if (io->nwin > 1) { |
751 | p_dev->io.Attributes2 = p_dev->io.Attributes1; | 740 | p_dev->resource[1]->flags = p_dev->resource[0]->flags; |
752 | p_dev->io.BasePort2 = io->win[1].base; | 741 | p_dev->resource[1]->start = io->win[1].base; |
753 | p_dev->io.NumPorts2 = io->win[1].len; | 742 | p_dev->resource[1]->end = io->win[1].len; |
754 | } | 743 | } |
755 | /* This reserves IO space but doesn't actually enable it */ | 744 | /* This reserves IO space but doesn't actually enable it */ |
756 | return pcmcia_request_io(p_dev, &p_dev->io); | 745 | return pcmcia_request_io(p_dev); |
757 | } | 746 | } |
758 | 747 | ||
759 | return 0; | 748 | return 0; |
@@ -787,12 +776,10 @@ static void das16cs_pcmcia_config(struct pcmcia_device *link) | |||
787 | dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex); | 776 | dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex); |
788 | if (link->conf.Attributes & CONF_ENABLE_IRQ) | 777 | if (link->conf.Attributes & CONF_ENABLE_IRQ) |
789 | printk(", irq %u", link->irq); | 778 | printk(", irq %u", link->irq); |
790 | if (link->io.NumPorts1) | 779 | if (link->resource[0]) |
791 | printk(", io 0x%04x-0x%04x", link->io.BasePort1, | 780 | printk(", io %pR", link->resource[0]); |
792 | link->io.BasePort1 + link->io.NumPorts1 - 1); | 781 | if (link->resource[1]) |
793 | if (link->io.NumPorts2) | 782 | printk(", io %pR", link->resource[1]); |
794 | printk(" & 0x%04x-0x%04x", link->io.BasePort2, | ||
795 | link->io.BasePort2 + link->io.NumPorts2 - 1); | ||
796 | printk("\n"); | 783 | printk("\n"); |
797 | 784 | ||
798 | return; | 785 | return; |
@@ -846,7 +833,7 @@ struct pcmcia_driver das16cs_driver = { | |||
846 | .id_table = das16cs_id_table, | 833 | .id_table = das16cs_id_table, |
847 | .owner = THIS_MODULE, | 834 | .owner = THIS_MODULE, |
848 | .drv = { | 835 | .drv = { |
849 | .name = dev_info, | 836 | .name = "cb_das16_cs", |
850 | }, | 837 | }, |
851 | }; | 838 | }; |
852 | 839 | ||
diff --git a/drivers/staging/comedi/drivers/das08_cs.c b/drivers/staging/comedi/drivers/das08_cs.c index fb561ab7f07c..c6aa52f8dcee 100644 --- a/drivers/staging/comedi/drivers/das08_cs.c +++ b/drivers/staging/comedi/drivers/das08_cs.c | |||
@@ -48,7 +48,6 @@ Command support does not exist, but could be added for this board. | |||
48 | #include "das08.h" | 48 | #include "das08.h" |
49 | 49 | ||
50 | /* pcmcia includes */ | 50 | /* pcmcia includes */ |
51 | #include <pcmcia/cs_types.h> | ||
52 | #include <pcmcia/cs.h> | 51 | #include <pcmcia/cs.h> |
53 | #include <pcmcia/cistpl.h> | 52 | #include <pcmcia/cistpl.h> |
54 | #include <pcmcia/ds.h> | 53 | #include <pcmcia/ds.h> |
@@ -89,7 +88,7 @@ static int das08_cs_attach(struct comedi_device *dev, | |||
89 | printk(" no pcmcia cards found\n"); | 88 | printk(" no pcmcia cards found\n"); |
90 | return -EIO; | 89 | return -EIO; |
91 | } | 90 | } |
92 | iobase = link->io.BasePort1; | 91 | iobase = link->resource[0]->start; |
93 | } else { | 92 | } else { |
94 | printk(" bug! board does not have PCMCIA bustype\n"); | 93 | printk(" bug! board does not have PCMCIA bustype\n"); |
95 | return -EINVAL; | 94 | return -EINVAL; |
@@ -132,14 +131,6 @@ static void das08_pcmcia_detach(struct pcmcia_device *); | |||
132 | less on other parts of the kernel. | 131 | less on other parts of the kernel. |
133 | */ | 132 | */ |
134 | 133 | ||
135 | /* | ||
136 | The dev_info variable is the "key" that is used to match up this | ||
137 | device driver with appropriate cards, through the card configuration | ||
138 | database. | ||
139 | */ | ||
140 | |||
141 | static const dev_info_t dev_info = "pcm-das08"; | ||
142 | |||
143 | struct local_info_t { | 134 | struct local_info_t { |
144 | struct pcmcia_device *link; | 135 | struct pcmcia_device *link; |
145 | int stop; | 136 | int stop; |
@@ -224,24 +215,23 @@ static int das08_pcmcia_config_loop(struct pcmcia_device *p_dev, | |||
224 | p_dev->conf.Attributes |= CONF_ENABLE_IRQ; | 215 | p_dev->conf.Attributes |= CONF_ENABLE_IRQ; |
225 | 216 | ||
226 | /* IO window settings */ | 217 | /* IO window settings */ |
227 | p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; | 218 | p_dev->resource[0]->end = p_dev->resource[1]->end = 0; |
228 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { | 219 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { |
229 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; | 220 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; |
230 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 221 | p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK; |
231 | if (!(io->flags & CISTPL_IO_8BIT)) | 222 | p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; |
232 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; | 223 | p_dev->resource[0]->flags |= |
233 | if (!(io->flags & CISTPL_IO_16BIT)) | 224 | pcmcia_io_cfg_data_width(io->flags); |
234 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | ||
235 | p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; | 225 | p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; |
236 | p_dev->io.BasePort1 = io->win[0].base; | 226 | p_dev->resource[0]->start = io->win[0].base; |
237 | p_dev->io.NumPorts1 = io->win[0].len; | 227 | p_dev->resource[0]->end = io->win[0].len; |
238 | if (io->nwin > 1) { | 228 | if (io->nwin > 1) { |
239 | p_dev->io.Attributes2 = p_dev->io.Attributes1; | 229 | p_dev->resource[1]->flags = p_dev->resource[0]->flags; |
240 | p_dev->io.BasePort2 = io->win[1].base; | 230 | p_dev->resource[1]->start = io->win[1].base; |
241 | p_dev->io.NumPorts2 = io->win[1].len; | 231 | p_dev->resource[1]->end = io->win[1].len; |
242 | } | 232 | } |
243 | /* This reserves IO space but doesn't actually enable it */ | 233 | /* This reserves IO space but doesn't actually enable it */ |
244 | return pcmcia_request_io(p_dev, &p_dev->io); | 234 | return pcmcia_request_io(p_dev); |
245 | } | 235 | } |
246 | return 0; | 236 | return 0; |
247 | } | 237 | } |
@@ -283,12 +273,10 @@ static void das08_pcmcia_config(struct pcmcia_device *link) | |||
283 | dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex); | 273 | dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex); |
284 | if (link->conf.Attributes & CONF_ENABLE_IRQ) | 274 | if (link->conf.Attributes & CONF_ENABLE_IRQ) |
285 | printk(", irq %u", link->irq); | 275 | printk(", irq %u", link->irq); |
286 | if (link->io.NumPorts1) | 276 | if (link->resource[0]) |
287 | printk(", io 0x%04x-0x%04x", link->io.BasePort1, | 277 | printk(", io %pR", link->resource[0]); |
288 | link->io.BasePort1 + link->io.NumPorts1 - 1); | 278 | if (link->resource[1]) |
289 | if (link->io.NumPorts2) | 279 | printk(" & %pR", link->resource[1]); |
290 | printk(" & 0x%04x-0x%04x", link->io.BasePort2, | ||
291 | link->io.BasePort2 + link->io.NumPorts2 - 1); | ||
292 | printk("\n"); | 280 | printk("\n"); |
293 | 281 | ||
294 | return; | 282 | return; |
@@ -362,7 +350,7 @@ struct pcmcia_driver das08_cs_driver = { | |||
362 | .id_table = das08_cs_id_table, | 350 | .id_table = das08_cs_id_table, |
363 | .owner = THIS_MODULE, | 351 | .owner = THIS_MODULE, |
364 | .drv = { | 352 | .drv = { |
365 | .name = dev_info, | 353 | .name = "pcm-das08", |
366 | }, | 354 | }, |
367 | }; | 355 | }; |
368 | 356 | ||
diff --git a/drivers/staging/comedi/drivers/ni_daq_700.c b/drivers/staging/comedi/drivers/ni_daq_700.c index 701abd9eabe6..cc15666e5cc1 100644 --- a/drivers/staging/comedi/drivers/ni_daq_700.c +++ b/drivers/staging/comedi/drivers/ni_daq_700.c | |||
@@ -47,7 +47,6 @@ IRQ is assigned but not used. | |||
47 | 47 | ||
48 | #include <linux/ioport.h> | 48 | #include <linux/ioport.h> |
49 | 49 | ||
50 | #include <pcmcia/cs_types.h> | ||
51 | #include <pcmcia/cs.h> | 50 | #include <pcmcia/cs.h> |
52 | #include <pcmcia/cistpl.h> | 51 | #include <pcmcia/cistpl.h> |
53 | #include <pcmcia/cisreg.h> | 52 | #include <pcmcia/cisreg.h> |
@@ -377,7 +376,7 @@ static int dio700_attach(struct comedi_device *dev, struct comedi_devconfig *it) | |||
377 | link = pcmcia_cur_dev; /* XXX hack */ | 376 | link = pcmcia_cur_dev; /* XXX hack */ |
378 | if (!link) | 377 | if (!link) |
379 | return -EIO; | 378 | return -EIO; |
380 | iobase = link->io.BasePort1; | 379 | iobase = link->resource[0]->start; |
381 | #ifdef incomplete | 380 | #ifdef incomplete |
382 | irq = link->irq; | 381 | irq = link->irq; |
383 | #endif | 382 | #endif |
@@ -459,14 +458,6 @@ static void dio700_cs_detach(struct pcmcia_device *); | |||
459 | less on other parts of the kernel. | 458 | less on other parts of the kernel. |
460 | */ | 459 | */ |
461 | 460 | ||
462 | /* | ||
463 | The dev_info variable is the "key" that is used to match up this | ||
464 | device driver with appropriate cards, through the card configuration | ||
465 | database. | ||
466 | */ | ||
467 | |||
468 | static const dev_info_t dev_info = "ni_daq_700"; | ||
469 | |||
470 | struct local_info_t { | 461 | struct local_info_t { |
471 | struct pcmcia_device *link; | 462 | struct pcmcia_device *link; |
472 | int stop; | 463 | int stop; |
@@ -555,9 +546,6 @@ static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev, | |||
555 | unsigned int vcc, | 546 | unsigned int vcc, |
556 | void *priv_data) | 547 | void *priv_data) |
557 | { | 548 | { |
558 | win_req_t *req = priv_data; | ||
559 | memreq_t map; | ||
560 | |||
561 | if (cfg->index == 0) | 549 | if (cfg->index == 0) |
562 | return -ENODEV; | 550 | return -ENODEV; |
563 | 551 | ||
@@ -571,44 +559,25 @@ static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev, | |||
571 | p_dev->conf.Attributes |= CONF_ENABLE_IRQ; | 559 | p_dev->conf.Attributes |= CONF_ENABLE_IRQ; |
572 | 560 | ||
573 | /* IO window settings */ | 561 | /* IO window settings */ |
574 | p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; | 562 | p_dev->resource[0]->end = p_dev->resource[1]->end = 0; |
575 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { | 563 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { |
576 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; | 564 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; |
577 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 565 | p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK; |
578 | if (!(io->flags & CISTPL_IO_8BIT)) | 566 | p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; |
579 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; | 567 | p_dev->resource[0]->flags |= |
580 | if (!(io->flags & CISTPL_IO_16BIT)) | 568 | pcmcia_io_cfg_data_width(io->flags); |
581 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | 569 | p_dev->resource[0]->start = io->win[0].base; |
582 | p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; | 570 | p_dev->resource[0]->end = io->win[0].len; |
583 | p_dev->io.BasePort1 = io->win[0].base; | ||
584 | p_dev->io.NumPorts1 = io->win[0].len; | ||
585 | if (io->nwin > 1) { | 571 | if (io->nwin > 1) { |
586 | p_dev->io.Attributes2 = p_dev->io.Attributes1; | 572 | p_dev->resource[1]->flags = p_dev->resource[0]->flags; |
587 | p_dev->io.BasePort2 = io->win[1].base; | 573 | p_dev->resource[1]->start = io->win[1].base; |
588 | p_dev->io.NumPorts2 = io->win[1].len; | 574 | p_dev->resource[1]->end = io->win[1].len; |
589 | } | 575 | } |
590 | /* This reserves IO space but doesn't actually enable it */ | 576 | /* This reserves IO space but doesn't actually enable it */ |
591 | if (pcmcia_request_io(p_dev, &p_dev->io) != 0) | 577 | if (pcmcia_request_io(p_dev) != 0) |
592 | return -ENODEV; | 578 | return -ENODEV; |
593 | } | 579 | } |
594 | 580 | ||
595 | if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) { | ||
596 | cistpl_mem_t *mem = | ||
597 | (cfg->mem.nwin) ? &cfg->mem : &dflt->mem; | ||
598 | req->Attributes = WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM; | ||
599 | req->Attributes |= WIN_ENABLE; | ||
600 | req->Base = mem->win[0].host_addr; | ||
601 | req->Size = mem->win[0].len; | ||
602 | if (req->Size < 0x1000) | ||
603 | req->Size = 0x1000; | ||
604 | req->AccessSpeed = 0; | ||
605 | if (pcmcia_request_window(p_dev, req, &p_dev->win)) | ||
606 | return -ENODEV; | ||
607 | map.Page = 0; | ||
608 | map.CardOffset = mem->win[0].card_addr; | ||
609 | if (pcmcia_map_mem_page(p_dev, p_dev->win, &map)) | ||
610 | return -ENODEV; | ||
611 | } | ||
612 | /* If we got this far, we're cool! */ | 581 | /* If we got this far, we're cool! */ |
613 | return 0; | 582 | return 0; |
614 | } | 583 | } |
@@ -622,7 +591,7 @@ static void dio700_config(struct pcmcia_device *link) | |||
622 | 591 | ||
623 | dev_dbg(&link->dev, "dio700_config\n"); | 592 | dev_dbg(&link->dev, "dio700_config\n"); |
624 | 593 | ||
625 | ret = pcmcia_loop_config(link, dio700_pcmcia_config_loop, &req); | 594 | ret = pcmcia_loop_config(link, dio700_pcmcia_config_loop, NULL); |
626 | if (ret) { | 595 | if (ret) { |
627 | dev_warn(&link->dev, "no configuration found\n"); | 596 | dev_warn(&link->dev, "no configuration found\n"); |
628 | goto failed; | 597 | goto failed; |
@@ -644,15 +613,10 @@ static void dio700_config(struct pcmcia_device *link) | |||
644 | dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex); | 613 | dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex); |
645 | if (link->conf.Attributes & CONF_ENABLE_IRQ) | 614 | if (link->conf.Attributes & CONF_ENABLE_IRQ) |
646 | printk(", irq %d", link->irq); | 615 | printk(", irq %d", link->irq); |
647 | if (link->io.NumPorts1) | 616 | if (link->resource[0]) |
648 | printk(", io 0x%04x-0x%04x", link->io.BasePort1, | 617 | printk(", io %pR", link->resource[0]); |
649 | link->io.BasePort1 + link->io.NumPorts1 - 1); | 618 | if (link->resource[1]) |
650 | if (link->io.NumPorts2) | 619 | printk(" & %pR", link->resource[1]); |
651 | printk(" & 0x%04x-0x%04x", link->io.BasePort2, | ||
652 | link->io.BasePort2 + link->io.NumPorts2 - 1); | ||
653 | if (link->win) | ||
654 | printk(", mem 0x%06lx-0x%06lx", req.Base, | ||
655 | req.Base + req.Size - 1); | ||
656 | printk("\n"); | 620 | printk("\n"); |
657 | 621 | ||
658 | return; | 622 | return; |
@@ -722,7 +686,7 @@ struct pcmcia_driver dio700_cs_driver = { | |||
722 | .id_table = dio700_cs_ids, | 686 | .id_table = dio700_cs_ids, |
723 | .owner = THIS_MODULE, | 687 | .owner = THIS_MODULE, |
724 | .drv = { | 688 | .drv = { |
725 | .name = dev_info, | 689 | .name = "ni_daq_700", |
726 | }, | 690 | }, |
727 | }; | 691 | }; |
728 | 692 | ||
diff --git a/drivers/staging/comedi/drivers/ni_daq_dio24.c b/drivers/staging/comedi/drivers/ni_daq_dio24.c index 0b65f247d5dd..773ae2044e0e 100644 --- a/drivers/staging/comedi/drivers/ni_daq_dio24.c +++ b/drivers/staging/comedi/drivers/ni_daq_dio24.c | |||
@@ -48,7 +48,6 @@ the PCMCIA interface. | |||
48 | 48 | ||
49 | #include "8255.h" | 49 | #include "8255.h" |
50 | 50 | ||
51 | #include <pcmcia/cs_types.h> | ||
52 | #include <pcmcia/cs.h> | 51 | #include <pcmcia/cs.h> |
53 | #include <pcmcia/cistpl.h> | 52 | #include <pcmcia/cistpl.h> |
54 | #include <pcmcia/cisreg.h> | 53 | #include <pcmcia/cisreg.h> |
@@ -129,7 +128,7 @@ static int dio24_attach(struct comedi_device *dev, struct comedi_devconfig *it) | |||
129 | link = pcmcia_cur_dev; /* XXX hack */ | 128 | link = pcmcia_cur_dev; /* XXX hack */ |
130 | if (!link) | 129 | if (!link) |
131 | return -EIO; | 130 | return -EIO; |
132 | iobase = link->io.BasePort1; | 131 | iobase = link->resource[0]->start; |
133 | #ifdef incomplete | 132 | #ifdef incomplete |
134 | irq = link->irq; | 133 | irq = link->irq; |
135 | #endif | 134 | #endif |
@@ -211,14 +210,6 @@ static void dio24_cs_detach(struct pcmcia_device *); | |||
211 | less on other parts of the kernel. | 210 | less on other parts of the kernel. |
212 | */ | 211 | */ |
213 | 212 | ||
214 | /* | ||
215 | The dev_info variable is the "key" that is used to match up this | ||
216 | device driver with appropriate cards, through the card configuration | ||
217 | database. | ||
218 | */ | ||
219 | |||
220 | static const dev_info_t dev_info = "ni_daq_dio24"; | ||
221 | |||
222 | struct local_info_t { | 213 | struct local_info_t { |
223 | struct pcmcia_device *link; | 214 | struct pcmcia_device *link; |
224 | int stop; | 215 | int stop; |
@@ -307,9 +298,6 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev, | |||
307 | unsigned int vcc, | 298 | unsigned int vcc, |
308 | void *priv_data) | 299 | void *priv_data) |
309 | { | 300 | { |
310 | win_req_t *req = priv_data; | ||
311 | memreq_t map; | ||
312 | |||
313 | if (cfg->index == 0) | 301 | if (cfg->index == 0) |
314 | return -ENODEV; | 302 | return -ENODEV; |
315 | 303 | ||
@@ -323,44 +311,25 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev, | |||
323 | p_dev->conf.Attributes |= CONF_ENABLE_IRQ; | 311 | p_dev->conf.Attributes |= CONF_ENABLE_IRQ; |
324 | 312 | ||
325 | /* IO window settings */ | 313 | /* IO window settings */ |
326 | p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; | 314 | p_dev->resource[0]->end = p_dev->resource[1]->end = 0; |
327 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { | 315 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { |
328 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; | 316 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; |
329 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 317 | p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK; |
330 | if (!(io->flags & CISTPL_IO_8BIT)) | 318 | p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; |
331 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; | 319 | p_dev->resource[0]->flags |= |
332 | if (!(io->flags & CISTPL_IO_16BIT)) | 320 | pcmcia_io_cfg_data_width(io->flags); |
333 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | 321 | p_dev->resource[0]->start = io->win[0].base; |
334 | p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; | 322 | p_dev->resource[0]->end = io->win[0].len; |
335 | p_dev->io.BasePort1 = io->win[0].base; | ||
336 | p_dev->io.NumPorts1 = io->win[0].len; | ||
337 | if (io->nwin > 1) { | 323 | if (io->nwin > 1) { |
338 | p_dev->io.Attributes2 = p_dev->io.Attributes1; | 324 | p_dev->resource[1]->flags = p_dev->resource[0]->flags; |
339 | p_dev->io.BasePort2 = io->win[1].base; | 325 | p_dev->resource[1]->start = io->win[1].base; |
340 | p_dev->io.NumPorts2 = io->win[1].len; | 326 | p_dev->resource[1]->end = io->win[1].len; |
341 | } | 327 | } |
342 | /* This reserves IO space but doesn't actually enable it */ | 328 | /* This reserves IO space but doesn't actually enable it */ |
343 | if (pcmcia_request_io(p_dev, &p_dev->io) != 0) | 329 | if (pcmcia_request_io(p_dev) != 0) |
344 | return -ENODEV; | 330 | return -ENODEV; |
345 | } | 331 | } |
346 | 332 | ||
347 | if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) { | ||
348 | cistpl_mem_t *mem = | ||
349 | (cfg->mem.nwin) ? &cfg->mem : &dflt->mem; | ||
350 | req->Attributes = WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM; | ||
351 | req->Attributes |= WIN_ENABLE; | ||
352 | req->Base = mem->win[0].host_addr; | ||
353 | req->Size = mem->win[0].len; | ||
354 | if (req->Size < 0x1000) | ||
355 | req->Size = 0x1000; | ||
356 | req->AccessSpeed = 0; | ||
357 | if (pcmcia_request_window(p_dev, req, &p_dev->win)) | ||
358 | return -ENODEV; | ||
359 | map.Page = 0; | ||
360 | map.CardOffset = mem->win[0].card_addr; | ||
361 | if (pcmcia_map_mem_page(p_dev, p_dev->win, &map)) | ||
362 | return -ENODEV; | ||
363 | } | ||
364 | /* If we got this far, we're cool! */ | 333 | /* If we got this far, we're cool! */ |
365 | return 0; | 334 | return 0; |
366 | } | 335 | } |
@@ -368,13 +337,12 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev, | |||
368 | static void dio24_config(struct pcmcia_device *link) | 337 | static void dio24_config(struct pcmcia_device *link) |
369 | { | 338 | { |
370 | int ret; | 339 | int ret; |
371 | win_req_t req; | ||
372 | 340 | ||
373 | printk(KERN_INFO "ni_daq_dio24: HOLA SOY YO! - config\n"); | 341 | printk(KERN_INFO "ni_daq_dio24: HOLA SOY YO! - config\n"); |
374 | 342 | ||
375 | dev_dbg(&link->dev, "dio24_config\n"); | 343 | dev_dbg(&link->dev, "dio24_config\n"); |
376 | 344 | ||
377 | ret = pcmcia_loop_config(link, dio24_pcmcia_config_loop, &req); | 345 | ret = pcmcia_loop_config(link, dio24_pcmcia_config_loop, NULL); |
378 | if (ret) { | 346 | if (ret) { |
379 | dev_warn(&link->dev, "no configuration found\n"); | 347 | dev_warn(&link->dev, "no configuration found\n"); |
380 | goto failed; | 348 | goto failed; |
@@ -396,15 +364,10 @@ static void dio24_config(struct pcmcia_device *link) | |||
396 | dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex); | 364 | dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex); |
397 | if (link->conf.Attributes & CONF_ENABLE_IRQ) | 365 | if (link->conf.Attributes & CONF_ENABLE_IRQ) |
398 | printk(", irq %d", link->irq); | 366 | printk(", irq %d", link->irq); |
399 | if (link->io.NumPorts1) | 367 | if (link->resource[0]) |
400 | printk(", io 0x%04x-0x%04x", link->io.BasePort1, | 368 | printk(" & %pR", link->resource[0]); |
401 | link->io.BasePort1 + link->io.NumPorts1 - 1); | 369 | if (link->resource[1]) |
402 | if (link->io.NumPorts2) | 370 | printk(" & %pR", link->resource[1]); |
403 | printk(" & 0x%04x-0x%04x", link->io.BasePort2, | ||
404 | link->io.BasePort2 + link->io.NumPorts2 - 1); | ||
405 | if (link->win) | ||
406 | printk(", mem 0x%06lx-0x%06lx", req.Base, | ||
407 | req.Base + req.Size - 1); | ||
408 | printk("\n"); | 371 | printk("\n"); |
409 | 372 | ||
410 | return; | 373 | return; |
@@ -473,7 +436,7 @@ struct pcmcia_driver dio24_cs_driver = { | |||
473 | .id_table = dio24_cs_ids, | 436 | .id_table = dio24_cs_ids, |
474 | .owner = THIS_MODULE, | 437 | .owner = THIS_MODULE, |
475 | .drv = { | 438 | .drv = { |
476 | .name = dev_info, | 439 | .name = "ni_daq_dio24", |
477 | }, | 440 | }, |
478 | }; | 441 | }; |
479 | 442 | ||
diff --git a/drivers/staging/comedi/drivers/ni_labpc_cs.c b/drivers/staging/comedi/drivers/ni_labpc_cs.c index 163245ebb311..68c4ecbd93ae 100644 --- a/drivers/staging/comedi/drivers/ni_labpc_cs.c +++ b/drivers/staging/comedi/drivers/ni_labpc_cs.c | |||
@@ -71,7 +71,6 @@ NI manuals: | |||
71 | #include "comedi_fc.h" | 71 | #include "comedi_fc.h" |
72 | #include "ni_labpc.h" | 72 | #include "ni_labpc.h" |
73 | 73 | ||
74 | #include <pcmcia/cs_types.h> | ||
75 | #include <pcmcia/cs.h> | 74 | #include <pcmcia/cs.h> |
76 | #include <pcmcia/cistpl.h> | 75 | #include <pcmcia/cistpl.h> |
77 | #include <pcmcia/cisreg.h> | 76 | #include <pcmcia/cisreg.h> |
@@ -143,7 +142,7 @@ static int labpc_attach(struct comedi_device *dev, struct comedi_devconfig *it) | |||
143 | link = pcmcia_cur_dev; /* XXX hack */ | 142 | link = pcmcia_cur_dev; /* XXX hack */ |
144 | if (!link) | 143 | if (!link) |
145 | return -EIO; | 144 | return -EIO; |
146 | iobase = link->io.BasePort1; | 145 | iobase = link->resource[0]->start; |
147 | irq = link->irq; | 146 | irq = link->irq; |
148 | break; | 147 | break; |
149 | default: | 148 | default: |
@@ -189,14 +188,6 @@ static void labpc_cs_detach(struct pcmcia_device *); | |||
189 | less on other parts of the kernel. | 188 | less on other parts of the kernel. |
190 | */ | 189 | */ |
191 | 190 | ||
192 | /* | ||
193 | The dev_info variable is the "key" that is used to match up this | ||
194 | device driver with appropriate cards, through the card configuration | ||
195 | database. | ||
196 | */ | ||
197 | |||
198 | static const dev_info_t dev_info = "daqcard-1200"; | ||
199 | |||
200 | struct local_info_t { | 191 | struct local_info_t { |
201 | struct pcmcia_device *link; | 192 | struct pcmcia_device *link; |
202 | int stop; | 193 | int stop; |
@@ -286,9 +277,6 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev, | |||
286 | unsigned int vcc, | 277 | unsigned int vcc, |
287 | void *priv_data) | 278 | void *priv_data) |
288 | { | 279 | { |
289 | win_req_t *req = priv_data; | ||
290 | memreq_t map; | ||
291 | |||
292 | if (cfg->index == 0) | 280 | if (cfg->index == 0) |
293 | return -ENODEV; | 281 | return -ENODEV; |
294 | 282 | ||
@@ -302,44 +290,25 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev, | |||
302 | p_dev->conf.Attributes |= CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ; | 290 | p_dev->conf.Attributes |= CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ; |
303 | 291 | ||
304 | /* IO window settings */ | 292 | /* IO window settings */ |
305 | p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; | 293 | p_dev->resource[0]->end = p_dev->resource[1]->end = 0; |
306 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { | 294 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { |
307 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; | 295 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; |
308 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 296 | p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK; |
309 | if (!(io->flags & CISTPL_IO_8BIT)) | 297 | p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; |
310 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; | 298 | p_dev->resource[0]->flags |= |
311 | if (!(io->flags & CISTPL_IO_16BIT)) | 299 | pcmcia_io_cfg_data_width(io->flags); |
312 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | 300 | p_dev->resource[0]->start = io->win[0].base; |
313 | p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; | 301 | p_dev->resource[0]->end = io->win[0].len; |
314 | p_dev->io.BasePort1 = io->win[0].base; | ||
315 | p_dev->io.NumPorts1 = io->win[0].len; | ||
316 | if (io->nwin > 1) { | 302 | if (io->nwin > 1) { |
317 | p_dev->io.Attributes2 = p_dev->io.Attributes1; | 303 | p_dev->resource[1]->flags = p_dev->resource[0]->flags; |
318 | p_dev->io.BasePort2 = io->win[1].base; | 304 | p_dev->resource[1]->start = io->win[1].base; |
319 | p_dev->io.NumPorts2 = io->win[1].len; | 305 | p_dev->resource[1]->end = io->win[1].len; |
320 | } | 306 | } |
321 | /* This reserves IO space but doesn't actually enable it */ | 307 | /* This reserves IO space but doesn't actually enable it */ |
322 | if (pcmcia_request_io(p_dev, &p_dev->io) != 0) | 308 | if (pcmcia_request_io(p_dev) != 0) |
323 | return -ENODEV; | 309 | return -ENODEV; |
324 | } | 310 | } |
325 | 311 | ||
326 | if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) { | ||
327 | cistpl_mem_t *mem = | ||
328 | (cfg->mem.nwin) ? &cfg->mem : &dflt->mem; | ||
329 | req->Attributes = WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM; | ||
330 | req->Attributes |= WIN_ENABLE; | ||
331 | req->Base = mem->win[0].host_addr; | ||
332 | req->Size = mem->win[0].len; | ||
333 | if (req->Size < 0x1000) | ||
334 | req->Size = 0x1000; | ||
335 | req->AccessSpeed = 0; | ||
336 | if (pcmcia_request_window(p_dev, req, &p_dev->win)) | ||
337 | return -ENODEV; | ||
338 | map.Page = 0; | ||
339 | map.CardOffset = mem->win[0].card_addr; | ||
340 | if (pcmcia_map_mem_page(p_dev, p_dev->win, &map)) | ||
341 | return -ENODEV; | ||
342 | } | ||
343 | /* If we got this far, we're cool! */ | 312 | /* If we got this far, we're cool! */ |
344 | return 0; | 313 | return 0; |
345 | } | 314 | } |
@@ -348,11 +317,10 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev, | |||
348 | static void labpc_config(struct pcmcia_device *link) | 317 | static void labpc_config(struct pcmcia_device *link) |
349 | { | 318 | { |
350 | int ret; | 319 | int ret; |
351 | win_req_t req; | ||
352 | 320 | ||
353 | dev_dbg(&link->dev, "labpc_config\n"); | 321 | dev_dbg(&link->dev, "labpc_config\n"); |
354 | 322 | ||
355 | ret = pcmcia_loop_config(link, labpc_pcmcia_config_loop, &req); | 323 | ret = pcmcia_loop_config(link, labpc_pcmcia_config_loop, NULL); |
356 | if (ret) { | 324 | if (ret) { |
357 | dev_warn(&link->dev, "no configuration found\n"); | 325 | dev_warn(&link->dev, "no configuration found\n"); |
358 | goto failed; | 326 | goto failed; |
@@ -374,15 +342,10 @@ static void labpc_config(struct pcmcia_device *link) | |||
374 | dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex); | 342 | dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex); |
375 | if (link->conf.Attributes & CONF_ENABLE_IRQ) | 343 | if (link->conf.Attributes & CONF_ENABLE_IRQ) |
376 | printk(", irq %d", link->irq); | 344 | printk(", irq %d", link->irq); |
377 | if (link->io.NumPorts1) | 345 | if (link->resource[0]) |
378 | printk(", io 0x%04x-0x%04x", link->io.BasePort1, | 346 | printk(" & %pR", link->resource[0]); |
379 | link->io.BasePort1 + link->io.NumPorts1 - 1); | 347 | if (link->resource[1]) |
380 | if (link->io.NumPorts2) | 348 | printk(" & %pR", link->resource[1]); |
381 | printk(" & 0x%04x-0x%04x", link->io.BasePort2, | ||
382 | link->io.BasePort2 + link->io.NumPorts2 - 1); | ||
383 | if (link->win) | ||
384 | printk(", mem 0x%06lx-0x%06lx", req.Base, | ||
385 | req.Base + req.Size - 1); | ||
386 | printk("\n"); | 349 | printk("\n"); |
387 | 350 | ||
388 | return; | 351 | return; |
@@ -449,7 +412,7 @@ struct pcmcia_driver labpc_cs_driver = { | |||
449 | .id_table = labpc_cs_ids, | 412 | .id_table = labpc_cs_ids, |
450 | .owner = THIS_MODULE, | 413 | .owner = THIS_MODULE, |
451 | .drv = { | 414 | .drv = { |
452 | .name = dev_info, | 415 | .name = "daqcard-1200", |
453 | }, | 416 | }, |
454 | }; | 417 | }; |
455 | 418 | ||
diff --git a/drivers/staging/comedi/drivers/ni_mio_cs.c b/drivers/staging/comedi/drivers/ni_mio_cs.c index 3a46f0c0bff9..1f2426352eb5 100644 --- a/drivers/staging/comedi/drivers/ni_mio_cs.c +++ b/drivers/staging/comedi/drivers/ni_mio_cs.c | |||
@@ -48,7 +48,6 @@ See the notes in the ni_atmio.o driver. | |||
48 | #include "ni_stc.h" | 48 | #include "ni_stc.h" |
49 | #include "8255.h" | 49 | #include "8255.h" |
50 | 50 | ||
51 | #include <pcmcia/cs_types.h> | ||
52 | #include <pcmcia/cs.h> | 51 | #include <pcmcia/cs.h> |
53 | #include <pcmcia/cistpl.h> | 52 | #include <pcmcia/cistpl.h> |
54 | #include <pcmcia/ds.h> | 53 | #include <pcmcia/ds.h> |
@@ -261,12 +260,11 @@ static void cs_release(struct pcmcia_device *link); | |||
261 | static void cs_detach(struct pcmcia_device *); | 260 | static void cs_detach(struct pcmcia_device *); |
262 | 261 | ||
263 | static struct pcmcia_device *cur_dev = NULL; | 262 | static struct pcmcia_device *cur_dev = NULL; |
264 | static const dev_info_t dev_info = "ni_mio_cs"; | ||
265 | 263 | ||
266 | static int cs_attach(struct pcmcia_device *link) | 264 | static int cs_attach(struct pcmcia_device *link) |
267 | { | 265 | { |
268 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; | 266 | link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16; |
269 | link->io.NumPorts1 = 16; | 267 | link->resource[0]->end = 16; |
270 | link->conf.Attributes = CONF_ENABLE_IRQ; | 268 | link->conf.Attributes = CONF_ENABLE_IRQ; |
271 | link->conf.IntType = INT_MEMORY_AND_IO; | 269 | link->conf.IntType = INT_MEMORY_AND_IO; |
272 | 270 | ||
@@ -311,13 +309,12 @@ static int mio_pcmcia_config_loop(struct pcmcia_device *p_dev, | |||
311 | { | 309 | { |
312 | int base, ret; | 310 | int base, ret; |
313 | 311 | ||
314 | p_dev->io.NumPorts1 = cfg->io.win[0].len; | 312 | p_dev->resource[0]->end = cfg->io.win[0].len; |
315 | p_dev->io.IOAddrLines = cfg->io.flags & CISTPL_IO_LINES_MASK; | 313 | p_dev->io_lines = cfg->io.flags & CISTPL_IO_LINES_MASK; |
316 | p_dev->io.NumPorts2 = 0; | ||
317 | 314 | ||
318 | for (base = 0x000; base < 0x400; base += 0x20) { | 315 | for (base = 0x000; base < 0x400; base += 0x20) { |
319 | p_dev->io.BasePort1 = base; | 316 | p_dev->resource[0]->start = base; |
320 | ret = pcmcia_request_io(p_dev, &p_dev->io); | 317 | ret = pcmcia_request_io(p_dev); |
321 | if (!ret) | 318 | if (!ret) |
322 | return 0; | 319 | return 0; |
323 | } | 320 | } |
@@ -356,7 +353,7 @@ static int mio_cs_attach(struct comedi_device *dev, struct comedi_devconfig *it) | |||
356 | return -EIO; | 353 | return -EIO; |
357 | 354 | ||
358 | dev->driver = &driver_ni_mio_cs; | 355 | dev->driver = &driver_ni_mio_cs; |
359 | dev->iobase = link->io.BasePort1; | 356 | dev->iobase = link->resource[0]->start; |
360 | 357 | ||
361 | irq = link->irq; | 358 | irq = link->irq; |
362 | 359 | ||
@@ -450,7 +447,7 @@ struct pcmcia_driver ni_mio_cs_driver = { | |||
450 | .id_table = ni_mio_cs_ids, | 447 | .id_table = ni_mio_cs_ids, |
451 | .owner = THIS_MODULE, | 448 | .owner = THIS_MODULE, |
452 | .drv = { | 449 | .drv = { |
453 | .name = dev_info, | 450 | .name = "ni_mio_cs", |
454 | }, | 451 | }, |
455 | }; | 452 | }; |
456 | 453 | ||
diff --git a/drivers/staging/comedi/drivers/quatech_daqp_cs.c b/drivers/staging/comedi/drivers/quatech_daqp_cs.c index 8b49cb12c2e5..bf489d7f4990 100644 --- a/drivers/staging/comedi/drivers/quatech_daqp_cs.c +++ b/drivers/staging/comedi/drivers/quatech_daqp_cs.c | |||
@@ -50,7 +50,6 @@ Devices: [Quatech] DAQP-208 (daqp), DAQP-308 | |||
50 | #include "../comedidev.h" | 50 | #include "../comedidev.h" |
51 | #include <linux/semaphore.h> | 51 | #include <linux/semaphore.h> |
52 | 52 | ||
53 | #include <pcmcia/cs_types.h> | ||
54 | #include <pcmcia/cs.h> | 53 | #include <pcmcia/cs.h> |
55 | #include <pcmcia/cistpl.h> | 54 | #include <pcmcia/cistpl.h> |
56 | #include <pcmcia/cisreg.h> | 55 | #include <pcmcia/cisreg.h> |
@@ -871,7 +870,7 @@ static int daqp_attach(struct comedi_device *dev, struct comedi_devconfig *it) | |||
871 | } | 870 | } |
872 | } | 871 | } |
873 | 872 | ||
874 | dev->iobase = local->link->io.BasePort1; | 873 | dev->iobase = local->link->resource[0]->start; |
875 | 874 | ||
876 | ret = alloc_subdevices(dev, 4); | 875 | ret = alloc_subdevices(dev, 4); |
877 | if (ret < 0) | 876 | if (ret < 0) |
@@ -995,14 +994,6 @@ static int daqp_cs_resume(struct pcmcia_device *p_dev); | |||
995 | static int daqp_cs_attach(struct pcmcia_device *); | 994 | static int daqp_cs_attach(struct pcmcia_device *); |
996 | static void daqp_cs_detach(struct pcmcia_device *); | 995 | static void daqp_cs_detach(struct pcmcia_device *); |
997 | 996 | ||
998 | /* | ||
999 | The dev_info variable is the "key" that is used to match up this | ||
1000 | device driver with appropriate cards, through the card configuration | ||
1001 | database. | ||
1002 | */ | ||
1003 | |||
1004 | static const dev_info_t dev_info = "quatech_daqp_cs"; | ||
1005 | |||
1006 | /*====================================================================== | 997 | /*====================================================================== |
1007 | 998 | ||
1008 | daqp_cs_attach() creates an "instance" of the driver, allocating | 999 | daqp_cs_attach() creates an "instance" of the driver, allocating |
@@ -1101,26 +1092,24 @@ static int daqp_pcmcia_config_loop(struct pcmcia_device *p_dev, | |||
1101 | p_dev->conf.Attributes |= CONF_ENABLE_IRQ; | 1092 | p_dev->conf.Attributes |= CONF_ENABLE_IRQ; |
1102 | 1093 | ||
1103 | /* IO window settings */ | 1094 | /* IO window settings */ |
1104 | p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; | 1095 | p_dev->resource[0]->end = p_dev->resource[1]->end = 0; |
1105 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { | 1096 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { |
1106 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; | 1097 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; |
1107 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 1098 | p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK; |
1108 | if (!(io->flags & CISTPL_IO_8BIT)) | 1099 | p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; |
1109 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; | 1100 | p_dev->resource[0]->flags |= |
1110 | if (!(io->flags & CISTPL_IO_16BIT)) | 1101 | pcmcia_io_cfg_data_width(io->flags); |
1111 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | 1102 | p_dev->resource[0]->start = io->win[0].base; |
1112 | p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; | 1103 | p_dev->resource[0]->end = io->win[0].len; |
1113 | p_dev->io.BasePort1 = io->win[0].base; | ||
1114 | p_dev->io.NumPorts1 = io->win[0].len; | ||
1115 | if (io->nwin > 1) { | 1104 | if (io->nwin > 1) { |
1116 | p_dev->io.Attributes2 = p_dev->io.Attributes1; | 1105 | p_dev->resource[1]->flags = p_dev->resource[0]->flags; |
1117 | p_dev->io.BasePort2 = io->win[1].base; | 1106 | p_dev->resource[1]->start = io->win[1].base; |
1118 | p_dev->io.NumPorts2 = io->win[1].len; | 1107 | p_dev->resource[1]->end = io->win[1].len; |
1119 | } | 1108 | } |
1120 | } | 1109 | } |
1121 | 1110 | ||
1122 | /* This reserves IO space but doesn't actually enable it */ | 1111 | /* This reserves IO space but doesn't actually enable it */ |
1123 | return pcmcia_request_io(p_dev, &p_dev->io); | 1112 | return pcmcia_request_io(p_dev); |
1124 | } | 1113 | } |
1125 | 1114 | ||
1126 | static void daqp_cs_config(struct pcmcia_device *link) | 1115 | static void daqp_cs_config(struct pcmcia_device *link) |
@@ -1151,13 +1140,11 @@ static void daqp_cs_config(struct pcmcia_device *link) | |||
1151 | /* Finally, report what we've done */ | 1140 | /* Finally, report what we've done */ |
1152 | dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex); | 1141 | dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex); |
1153 | if (link->conf.Attributes & CONF_ENABLE_IRQ) | 1142 | if (link->conf.Attributes & CONF_ENABLE_IRQ) |
1154 | printk(KERN_INFO ", irq %u", link->irq); | 1143 | printk(", irq %u", link->irq); |
1155 | if (link->io.NumPorts1) | 1144 | if (link->resource[0]) |
1156 | printk(", io 0x%04x-0x%04x", link->io.BasePort1, | 1145 | printk(" & %pR", link->resource[0]); |
1157 | link->io.BasePort1 + link->io.NumPorts1 - 1); | 1146 | if (link->resource[1]) |
1158 | if (link->io.NumPorts2) | 1147 | printk(" & %pR", link->resource[1]); |
1159 | printk(" & 0x%04x-0x%04x", link->io.BasePort2, | ||
1160 | link->io.BasePort2 + link->io.NumPorts2 - 1); | ||
1161 | printk("\n"); | 1148 | printk("\n"); |
1162 | 1149 | ||
1163 | return; | 1150 | return; |
@@ -1226,7 +1213,7 @@ static struct pcmcia_driver daqp_cs_driver = { | |||
1226 | .id_table = daqp_cs_id_table, | 1213 | .id_table = daqp_cs_id_table, |
1227 | .owner = THIS_MODULE, | 1214 | .owner = THIS_MODULE, |
1228 | .drv = { | 1215 | .drv = { |
1229 | .name = dev_info, | 1216 | .name = "quatech_daqp_cs", |
1230 | }, | 1217 | }, |
1231 | }; | 1218 | }; |
1232 | 1219 | ||
diff --git a/drivers/staging/wlags49_h2/wl_cs.c b/drivers/staging/wlags49_h2/wl_cs.c index 464b0673da42..19c335458653 100644 --- a/drivers/staging/wlags49_h2/wl_cs.c +++ b/drivers/staging/wlags49_h2/wl_cs.c | |||
@@ -83,7 +83,6 @@ | |||
83 | #include <linux/if_arp.h> | 83 | #include <linux/if_arp.h> |
84 | #include <linux/ioport.h> | 84 | #include <linux/ioport.h> |
85 | 85 | ||
86 | #include <pcmcia/cs_types.h> | ||
87 | #include <pcmcia/cs.h> | 86 | #include <pcmcia/cs.h> |
88 | #include <pcmcia/cistpl.h> | 87 | #include <pcmcia/cistpl.h> |
89 | #include <pcmcia/cisreg.h> | 88 | #include <pcmcia/cisreg.h> |
@@ -146,9 +145,8 @@ static int wl_adapter_attach(struct pcmcia_device *link) | |||
146 | return -ENOMEM; | 145 | return -ENOMEM; |
147 | } | 146 | } |
148 | 147 | ||
149 | link->io.NumPorts1 = HCF_NUM_IO_PORTS; | 148 | link->resource[0]->end = HCF_NUM_IO_PORTS; |
150 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; | 149 | link->resource[0]->flags= IO_DATA_PATH_WIDTH_16; |
151 | link->io.IOAddrLines = 6; | ||
152 | link->conf.Attributes = CONF_ENABLE_IRQ; | 150 | link->conf.Attributes = CONF_ENABLE_IRQ; |
153 | link->conf.IntType = INT_MEMORY_AND_IO; | 151 | link->conf.IntType = INT_MEMORY_AND_IO; |
154 | link->conf.ConfigIndex = 5; | 152 | link->conf.ConfigIndex = 5; |
@@ -305,8 +303,9 @@ void wl_adapter_insert(struct pcmcia_device *link) | |||
305 | 303 | ||
306 | /* Do we need to allocate an interrupt? */ | 304 | /* Do we need to allocate an interrupt? */ |
307 | link->conf.Attributes |= CONF_ENABLE_IRQ; | 305 | link->conf.Attributes |= CONF_ENABLE_IRQ; |
306 | link->io_lines = 6; | ||
308 | 307 | ||
309 | ret = pcmcia_request_io(link, &link->io); | 308 | ret = pcmcia_request_io(link); |
310 | if (ret != 0) | 309 | if (ret != 0) |
311 | goto failed; | 310 | goto failed; |
312 | 311 | ||
@@ -319,7 +318,7 @@ void wl_adapter_insert(struct pcmcia_device *link) | |||
319 | goto failed; | 318 | goto failed; |
320 | 319 | ||
321 | dev->irq = link->irq; | 320 | dev->irq = link->irq; |
322 | dev->base_addr = link->io.BasePort1; | 321 | dev->base_addr = link->resource[0]->start; |
323 | 322 | ||
324 | SET_NETDEV_DEV(dev, &link->dev); | 323 | SET_NETDEV_DEV(dev, &link->dev); |
325 | if (register_netdev(dev) != 0) { | 324 | if (register_netdev(dev) != 0) { |
diff --git a/drivers/staging/wlags49_h2/wl_internal.h b/drivers/staging/wlags49_h2/wl_internal.h index d9a0ad039c19..02f0a20e178a 100644 --- a/drivers/staging/wlags49_h2/wl_internal.h +++ b/drivers/staging/wlags49_h2/wl_internal.h | |||
@@ -69,7 +69,6 @@ | |||
69 | ******************************************************************************/ | 69 | ******************************************************************************/ |
70 | #include <linux/version.h> | 70 | #include <linux/version.h> |
71 | #ifdef BUS_PCMCIA | 71 | #ifdef BUS_PCMCIA |
72 | #include <pcmcia/cs_types.h> | ||
73 | #include <pcmcia/cs.h> | 72 | #include <pcmcia/cs.h> |
74 | #include <pcmcia/cistpl.h> | 73 | #include <pcmcia/cistpl.h> |
75 | #include <pcmcia/cisreg.h> | 74 | #include <pcmcia/cisreg.h> |