aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pcmcia
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-06 15:25:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-06 15:25:06 -0400
commit1685e633b396b0f3dabbc9fa5d65dfefe6435250 (patch)
treeee83e26e2468ca1518a1b065c690159e12c8def9 /drivers/scsi/pcmcia
parent1cfd2bda8c486ae0e7a8005354758ebb68172bca (diff)
parent127c03cdbad9bd5af5d7f33bd31a1015a90cb77f (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/scsi/pcmcia')
-rw-r--r--drivers/scsi/pcmcia/aha152x_stub.c17
-rw-r--r--drivers/scsi/pcmcia/fdomain_stub.c15
-rw-r--r--drivers/scsi/pcmcia/nsp_cs.c61
-rw-r--r--drivers/scsi/pcmcia/qlogic_stub.c33
-rw-r--r--drivers/scsi/pcmcia/sym53c500_cs.c31
5 files changed, 74 insertions, 83 deletions
diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c
index 9d70aef99227..61f49bdcc0c2 100644
--- a/drivers/scsi/pcmcia/aha152x_stub.c
+++ b/drivers/scsi/pcmcia/aha152x_stub.c
@@ -49,7 +49,6 @@
49#include <scsi/scsi_host.h> 49#include <scsi/scsi_host.h>
50#include "aha152x.h" 50#include "aha152x.h"
51 51
52#include <pcmcia/cs_types.h>
53#include <pcmcia/cs.h> 52#include <pcmcia/cs.h>
54#include <pcmcia/cistpl.h> 53#include <pcmcia/cistpl.h>
55#include <pcmcia/ds.h> 54#include <pcmcia/ds.h>
@@ -101,9 +100,8 @@ static int aha152x_probe(struct pcmcia_device *link)
101 info->p_dev = link; 100 info->p_dev = link;
102 link->priv = info; 101 link->priv = info;
103 102
104 link->io.NumPorts1 = 0x20; 103 link->resource[0]->end = 0x20;
105 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 104 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
106 link->io.IOAddrLines = 10;
107 link->conf.Attributes = CONF_ENABLE_IRQ; 105 link->conf.Attributes = CONF_ENABLE_IRQ;
108 link->conf.IntType = INT_MEMORY_AND_IO; 106 link->conf.IntType = INT_MEMORY_AND_IO;
109 link->conf.Present = PRESENT_OPTION; 107 link->conf.Present = PRESENT_OPTION;
@@ -131,15 +129,16 @@ static int aha152x_config_check(struct pcmcia_device *p_dev,
131 unsigned int vcc, 129 unsigned int vcc,
132 void *priv_data) 130 void *priv_data)
133{ 131{
132 p_dev->io_lines = 10;
134 /* For New Media T&J, look for a SCSI window */ 133 /* For New Media T&J, look for a SCSI window */
135 if (cfg->io.win[0].len >= 0x20) 134 if (cfg->io.win[0].len >= 0x20)
136 p_dev->io.BasePort1 = cfg->io.win[0].base; 135 p_dev->resource[0]->start = cfg->io.win[0].base;
137 else if ((cfg->io.nwin > 1) && 136 else if ((cfg->io.nwin > 1) &&
138 (cfg->io.win[1].len >= 0x20)) 137 (cfg->io.win[1].len >= 0x20))
139 p_dev->io.BasePort1 = cfg->io.win[1].base; 138 p_dev->resource[0]->start = cfg->io.win[1].base;
140 if ((cfg->io.nwin > 0) && 139 if ((cfg->io.nwin > 0) &&
141 (p_dev->io.BasePort1 < 0xffff)) { 140 (p_dev->resource[0]->start < 0xffff)) {
142 if (!pcmcia_request_io(p_dev, &p_dev->io)) 141 if (!pcmcia_request_io(p_dev))
143 return 0; 142 return 0;
144 } 143 }
145 return -EINVAL; 144 return -EINVAL;
@@ -168,7 +167,7 @@ static int aha152x_config_cs(struct pcmcia_device *link)
168 /* Set configuration options for the aha152x driver */ 167 /* Set configuration options for the aha152x driver */
169 memset(&s, 0, sizeof(s)); 168 memset(&s, 0, sizeof(s));
170 s.conf = "PCMCIA setup"; 169 s.conf = "PCMCIA setup";
171 s.io_port = link->io.BasePort1; 170 s.io_port = link->resource[0]->start;
172 s.irq = link->irq; 171 s.irq = link->irq;
173 s.scsiid = host_id; 172 s.scsiid = host_id;
174 s.reconnect = reconnect; 173 s.reconnect = reconnect;
diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c
index 21b141151dfc..13dbe5c48492 100644
--- a/drivers/scsi/pcmcia/fdomain_stub.c
+++ b/drivers/scsi/pcmcia/fdomain_stub.c
@@ -46,7 +46,6 @@
46#include <scsi/scsi_host.h> 46#include <scsi/scsi_host.h>
47#include "fdomain.h" 47#include "fdomain.h"
48 48
49#include <pcmcia/cs_types.h>
50#include <pcmcia/cs.h> 49#include <pcmcia/cs.h>
51#include <pcmcia/cistpl.h> 50#include <pcmcia/cistpl.h>
52#include <pcmcia/ds.h> 51#include <pcmcia/ds.h>
@@ -84,9 +83,8 @@ static int fdomain_probe(struct pcmcia_device *link)
84 83
85 info->p_dev = link; 84 info->p_dev = link;
86 link->priv = info; 85 link->priv = info;
87 link->io.NumPorts1 = 0x10; 86 link->resource[0]->end = 0x10;
88 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 87 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
89 link->io.IOAddrLines = 10;
90 link->conf.Attributes = CONF_ENABLE_IRQ; 88 link->conf.Attributes = CONF_ENABLE_IRQ;
91 link->conf.IntType = INT_MEMORY_AND_IO; 89 link->conf.IntType = INT_MEMORY_AND_IO;
92 link->conf.Present = PRESENT_OPTION; 90 link->conf.Present = PRESENT_OPTION;
@@ -113,8 +111,9 @@ static int fdomain_config_check(struct pcmcia_device *p_dev,
113 unsigned int vcc, 111 unsigned int vcc,
114 void *priv_data) 112 void *priv_data)
115{ 113{
116 p_dev->io.BasePort1 = cfg->io.win[0].base; 114 p_dev->io_lines = 10;
117 return pcmcia_request_io(p_dev, &p_dev->io); 115 p_dev->resource[0]->start = cfg->io.win[0].base;
116 return pcmcia_request_io(p_dev);
118} 117}
119 118
120 119
@@ -138,10 +137,10 @@ static int fdomain_config(struct pcmcia_device *link)
138 goto failed; 137 goto failed;
139 138
140 /* A bad hack... */ 139 /* A bad hack... */
141 release_region(link->io.BasePort1, link->io.NumPorts1); 140 release_region(link->resource[0]->start, resource_size(link->resource[0]));
142 141
143 /* Set configuration options for the fdomain driver */ 142 /* Set configuration options for the fdomain driver */
144 sprintf(str, "%d,%d", link->io.BasePort1, link->irq); 143 sprintf(str, "%d,%d", (unsigned int) link->resource[0]->start, link->irq);
145 fdomain_setup(str); 144 fdomain_setup(str);
146 145
147 host = __fdomain_16x0_detect(&fdomain_driver_template); 146 host = __fdomain_16x0_detect(&fdomain_driver_template);
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index 0f0e112c3f8e..dd9b40306f3d 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -47,7 +47,6 @@
47#include <scsi/scsi.h> 47#include <scsi/scsi.h>
48#include <scsi/scsi_ioctl.h> 48#include <scsi/scsi_ioctl.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>
@@ -1559,9 +1558,8 @@ static int nsp_cs_probe(struct pcmcia_device *link)
1559 nsp_dbg(NSP_DEBUG_INIT, "info=0x%p", info); 1558 nsp_dbg(NSP_DEBUG_INIT, "info=0x%p", info);
1560 1559
1561 /* The io structure describes IO port mapping */ 1560 /* The io structure describes IO port mapping */
1562 link->io.NumPorts1 = 0x10; 1561 link->resource[0]->end = 0x10;
1563 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 1562 link->resource[0]->flags = IO_DATA_PATH_WIDTH_AUTO;
1564 link->io.IOAddrLines = 10; /* not used */
1565 1563
1566 /* General socket configuration */ 1564 /* General socket configuration */
1567 link->conf.Attributes = CONF_ENABLE_IRQ; 1565 link->conf.Attributes = CONF_ENABLE_IRQ;
@@ -1642,29 +1640,27 @@ static int nsp_cs_config_check(struct pcmcia_device *p_dev,
1642 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 1640 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
1643 1641
1644 /* IO window settings */ 1642 /* IO window settings */
1645 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 1643 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
1646 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 1644 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
1647 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 1645 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
1648 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 1646 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
1649 if (!(io->flags & CISTPL_IO_8BIT)) 1647 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
1650 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 1648 p_dev->resource[0]->flags |=
1651 if (!(io->flags & CISTPL_IO_16BIT)) 1649 pcmcia_io_cfg_data_width(io->flags);
1652 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 1650 p_dev->resource[0]->start = io->win[0].base;
1653 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; 1651 p_dev->resource[0]->end = io->win[0].len;
1654 p_dev->io.BasePort1 = io->win[0].base;
1655 p_dev->io.NumPorts1 = io->win[0].len;
1656 if (io->nwin > 1) { 1652 if (io->nwin > 1) {
1657 p_dev->io.Attributes2 = p_dev->io.Attributes1; 1653 p_dev->resource[1]->flags =
1658 p_dev->io.BasePort2 = io->win[1].base; 1654 p_dev->resource[0]->flags;
1659 p_dev->io.NumPorts2 = io->win[1].len; 1655 p_dev->resource[1]->start = io->win[1].base;
1656 p_dev->resource[1]->end = io->win[1].len;
1660 } 1657 }
1661 /* This reserves IO space but doesn't actually enable it */ 1658 /* This reserves IO space but doesn't actually enable it */
1662 if (pcmcia_request_io(p_dev, &p_dev->io) != 0) 1659 if (pcmcia_request_io(p_dev) != 0)
1663 goto next_entry; 1660 goto next_entry;
1664 } 1661 }
1665 1662
1666 if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) { 1663 if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) {
1667 memreq_t map;
1668 cistpl_mem_t *mem = 1664 cistpl_mem_t *mem =
1669 (cfg->mem.nwin) ? &cfg->mem : &dflt->mem; 1665 (cfg->mem.nwin) ? &cfg->mem : &dflt->mem;
1670 cfg_mem->req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM; 1666 cfg_mem->req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM;
@@ -1676,8 +1672,8 @@ static int nsp_cs_config_check(struct pcmcia_device *p_dev,
1676 cfg_mem->req.AccessSpeed = 0; 1672 cfg_mem->req.AccessSpeed = 0;
1677 if (pcmcia_request_window(p_dev, &cfg_mem->req, &p_dev->win) != 0) 1673 if (pcmcia_request_window(p_dev, &cfg_mem->req, &p_dev->win) != 0)
1678 goto next_entry; 1674 goto next_entry;
1679 map.Page = 0; map.CardOffset = mem->win[0].card_addr; 1675 if (pcmcia_map_mem_page(p_dev, p_dev->win,
1680 if (pcmcia_map_mem_page(p_dev, p_dev->win, &map) != 0) 1676 mem->win[0].card_addr) != 0)
1681 goto next_entry; 1677 goto next_entry;
1682 1678
1683 cfg_mem->data->MmioAddress = (unsigned long) ioremap_nocache(cfg_mem->req.Base, cfg_mem->req.Size); 1679 cfg_mem->data->MmioAddress = (unsigned long) ioremap_nocache(cfg_mem->req.Base, cfg_mem->req.Size);
@@ -1720,17 +1716,19 @@ static int nsp_cs_config(struct pcmcia_device *link)
1720 goto cs_failed; 1716 goto cs_failed;
1721 1717
1722 if (free_ports) { 1718 if (free_ports) {
1723 if (link->io.BasePort1) { 1719 if (link->resource[0]) {
1724 release_region(link->io.BasePort1, link->io.NumPorts1); 1720 release_region(link->resource[0]->start,
1721 resource_size(link->resource[0]));
1725 } 1722 }
1726 if (link->io.BasePort2) { 1723 if (link->resource[1]) {
1727 release_region(link->io.BasePort2, link->io.NumPorts2); 1724 release_region(link->resource[1]->start,
1725 resource_size(link->resource[1]));
1728 } 1726 }
1729 } 1727 }
1730 1728
1731 /* Set port and IRQ */ 1729 /* Set port and IRQ */
1732 data->BaseAddress = link->io.BasePort1; 1730 data->BaseAddress = link->resource[0]->start;
1733 data->NumAddress = link->io.NumPorts1; 1731 data->NumAddress = resource_size(link->resource[0]);
1734 data->IrqNumber = link->irq; 1732 data->IrqNumber = link->irq;
1735 1733
1736 nsp_dbg(NSP_DEBUG_INIT, "I/O[0x%x+0x%x] IRQ %d", 1734 nsp_dbg(NSP_DEBUG_INIT, "I/O[0x%x+0x%x] IRQ %d",
@@ -1765,13 +1763,10 @@ static int nsp_cs_config(struct pcmcia_device *link)
1765 if (link->conf.Attributes & CONF_ENABLE_IRQ) { 1763 if (link->conf.Attributes & CONF_ENABLE_IRQ) {
1766 printk(", irq %d", link->irq); 1764 printk(", irq %d", link->irq);
1767 } 1765 }
1768 if (link->io.NumPorts1) { 1766 if (link->resource[0])
1769 printk(", io 0x%04x-0x%04x", link->io.BasePort1, 1767 printk(", io %pR", link->resource[0]);
1770 link->io.BasePort1+link->io.NumPorts1-1); 1768 if (link->resource[1])
1771 } 1769 printk(" & %pR", link->resource[1]);
1772 if (link->io.NumPorts2)
1773 printk(" & 0x%04x-0x%04x", link->io.BasePort2,
1774 link->io.BasePort2+link->io.NumPorts2-1);
1775 if (link->win) 1770 if (link->win)
1776 printk(", mem 0x%06lx-0x%06lx", cfg_mem->req.Base, 1771 printk(", mem 0x%06lx-0x%06lx", cfg_mem->req.Base,
1777 cfg_mem->req.Base+cfg_mem->req.Size-1); 1772 cfg_mem->req.Base+cfg_mem->req.Size-1);
diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c
index f0fc6baed9fc..eb775f1a523c 100644
--- a/drivers/scsi/pcmcia/qlogic_stub.c
+++ b/drivers/scsi/pcmcia/qlogic_stub.c
@@ -48,7 +48,6 @@
48#include <scsi/scsi_host.h> 48#include <scsi/scsi_host.h>
49#include "../qlogicfas408.h" 49#include "../qlogicfas408.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>
@@ -157,9 +156,8 @@ static int qlogic_probe(struct pcmcia_device *link)
157 return -ENOMEM; 156 return -ENOMEM;
158 info->p_dev = link; 157 info->p_dev = link;
159 link->priv = info; 158 link->priv = info;
160 link->io.NumPorts1 = 16; 159 link->resource[0]->end = 16;
161 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 160 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
162 link->io.IOAddrLines = 10;
163 link->conf.Attributes = CONF_ENABLE_IRQ; 161 link->conf.Attributes = CONF_ENABLE_IRQ;
164 link->conf.IntType = INT_MEMORY_AND_IO; 162 link->conf.IntType = INT_MEMORY_AND_IO;
165 link->conf.Present = PRESENT_OPTION; 163 link->conf.Present = PRESENT_OPTION;
@@ -186,13 +184,14 @@ static int qlogic_config_check(struct pcmcia_device *p_dev,
186 unsigned int vcc, 184 unsigned int vcc,
187 void *priv_data) 185 void *priv_data)
188{ 186{
189 p_dev->io.BasePort1 = cfg->io.win[0].base; 187 p_dev->io_lines = 10;
190 p_dev->io.NumPorts1 = cfg->io.win[0].len; 188 p_dev->resource[0]->start = cfg->io.win[0].base;
189 p_dev->resource[0]->end = cfg->io.win[0].len;
191 190
192 if (p_dev->io.BasePort1 == 0) 191 if (p_dev->resource[0]->start == 0)
193 return -ENODEV; 192 return -ENODEV;
194 193
195 return pcmcia_request_io(p_dev, &p_dev->io); 194 return pcmcia_request_io(p_dev);
196} 195}
197 196
198static int qlogic_config(struct pcmcia_device * link) 197static int qlogic_config(struct pcmcia_device * link)
@@ -216,18 +215,18 @@ static int qlogic_config(struct pcmcia_device * link)
216 215
217 if ((info->manf_id == MANFID_MACNICA) || (info->manf_id == MANFID_PIONEER) || (info->manf_id == 0x0098)) { 216 if ((info->manf_id == MANFID_MACNICA) || (info->manf_id == MANFID_PIONEER) || (info->manf_id == 0x0098)) {
218 /* set ATAcmd */ 217 /* set ATAcmd */
219 outb(0xb4, link->io.BasePort1 + 0xd); 218 outb(0xb4, link->resource[0]->start + 0xd);
220 outb(0x24, link->io.BasePort1 + 0x9); 219 outb(0x24, link->resource[0]->start + 0x9);
221 outb(0x04, link->io.BasePort1 + 0xd); 220 outb(0x04, link->resource[0]->start + 0xd);
222 } 221 }
223 222
224 /* The KXL-810AN has a bigger IO port window */ 223 /* The KXL-810AN has a bigger IO port window */
225 if (link->io.NumPorts1 == 32) 224 if (resource_size(link->resource[0]) == 32)
226 host = qlogic_detect(&qlogicfas_driver_template, link, 225 host = qlogic_detect(&qlogicfas_driver_template, link,
227 link->io.BasePort1 + 16, link->irq); 226 link->resource[0]->start + 16, link->irq);
228 else 227 else
229 host = qlogic_detect(&qlogicfas_driver_template, link, 228 host = qlogic_detect(&qlogicfas_driver_template, link,
230 link->io.BasePort1, link->irq); 229 link->resource[0]->start, link->irq);
231 230
232 if (!host) { 231 if (!host) {
233 printk(KERN_INFO "%s: no SCSI devices found\n", qlogic_name); 232 printk(KERN_INFO "%s: no SCSI devices found\n", qlogic_name);
@@ -269,9 +268,9 @@ static int qlogic_resume(struct pcmcia_device *link)
269 if ((info->manf_id == MANFID_MACNICA) || 268 if ((info->manf_id == MANFID_MACNICA) ||
270 (info->manf_id == MANFID_PIONEER) || 269 (info->manf_id == MANFID_PIONEER) ||
271 (info->manf_id == 0x0098)) { 270 (info->manf_id == 0x0098)) {
272 outb(0x80, link->io.BasePort1 + 0xd); 271 outb(0x80, link->resource[0]->start + 0xd);
273 outb(0x24, link->io.BasePort1 + 0x9); 272 outb(0x24, link->resource[0]->start + 0x9);
274 outb(0x04, link->io.BasePort1 + 0xd); 273 outb(0x04, link->resource[0]->start + 0xd);
275 } 274 }
276 /* Ugggglllyyyy!!! */ 275 /* Ugggglllyyyy!!! */
277 qlogicfas408_bus_reset(NULL); 276 qlogicfas408_bus_reset(NULL);
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c
index a51164171179..321e390c9120 100644
--- a/drivers/scsi/pcmcia/sym53c500_cs.c
+++ b/drivers/scsi/pcmcia/sym53c500_cs.c
@@ -71,7 +71,6 @@
71#include <scsi/scsi.h> 71#include <scsi/scsi.h>
72#include <scsi/scsi_host.h> 72#include <scsi/scsi_host.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/ds.h> 76#include <pcmcia/ds.h>
@@ -691,13 +690,14 @@ static int SYM53C500_config_check(struct pcmcia_device *p_dev,
691 unsigned int vcc, 690 unsigned int vcc,
692 void *priv_data) 691 void *priv_data)
693{ 692{
694 p_dev->io.BasePort1 = cfg->io.win[0].base; 693 p_dev->io_lines = 10;
695 p_dev->io.NumPorts1 = cfg->io.win[0].len; 694 p_dev->resource[0]->start = cfg->io.win[0].base;
695 p_dev->resource[0]->end = cfg->io.win[0].len;
696 696
697 if (p_dev->io.BasePort1 == 0) 697 if (p_dev->resource[0]->start == 0)
698 return -ENODEV; 698 return -ENODEV;
699 699
700 return pcmcia_request_io(p_dev, &p_dev->io); 700 return pcmcia_request_io(p_dev);
701} 701}
702 702
703static int 703static int
@@ -734,9 +734,9 @@ SYM53C500_config(struct pcmcia_device *link)
734 (info->manf_id == MANFID_PIONEER) || 734 (info->manf_id == MANFID_PIONEER) ||
735 (info->manf_id == 0x0098)) { 735 (info->manf_id == 0x0098)) {
736 /* set ATAcmd */ 736 /* set ATAcmd */
737 outb(0xb4, link->io.BasePort1 + 0xd); 737 outb(0xb4, link->resource[0]->start + 0xd);
738 outb(0x24, link->io.BasePort1 + 0x9); 738 outb(0x24, link->resource[0]->start + 0x9);
739 outb(0x04, link->io.BasePort1 + 0xd); 739 outb(0x04, link->resource[0]->start + 0xd);
740 } 740 }
741 741
742 /* 742 /*
@@ -749,7 +749,7 @@ SYM53C500_config(struct pcmcia_device *link)
749 * 0x130, 0x230, 0x280, 0x290, 749 * 0x130, 0x230, 0x280, 0x290,
750 * 0x320, 0x330, 0x340, 0x350 750 * 0x320, 0x330, 0x340, 0x350
751 */ 751 */
752 port_base = link->io.BasePort1; 752 port_base = link->resource[0]->start;
753 irq_level = link->irq; 753 irq_level = link->irq;
754 754
755 DEB(printk("SYM53C500: port_base=0x%x, irq=%d, fast_pio=%d\n", 755 DEB(printk("SYM53C500: port_base=0x%x, irq=%d, fast_pio=%d\n",
@@ -822,15 +822,15 @@ static int sym53c500_resume(struct pcmcia_device *link)
822 if ((info->manf_id == MANFID_MACNICA) || 822 if ((info->manf_id == MANFID_MACNICA) ||
823 (info->manf_id == MANFID_PIONEER) || 823 (info->manf_id == MANFID_PIONEER) ||
824 (info->manf_id == 0x0098)) { 824 (info->manf_id == 0x0098)) {
825 outb(0x80, link->io.BasePort1 + 0xd); 825 outb(0x80, link->resource[0]->start + 0xd);
826 outb(0x24, link->io.BasePort1 + 0x9); 826 outb(0x24, link->resource[0]->start + 0x9);
827 outb(0x04, link->io.BasePort1 + 0xd); 827 outb(0x04, link->resource[0]->start + 0xd);
828 } 828 }
829 /* 829 /*
830 * If things don't work after a "resume", 830 * If things don't work after a "resume",
831 * this is a good place to start looking. 831 * this is a good place to start looking.
832 */ 832 */
833 SYM53C500_int_host_reset(link->io.BasePort1); 833 SYM53C500_int_host_reset(link->resource[0]->start);
834 834
835 return 0; 835 return 0;
836} 836}
@@ -859,9 +859,8 @@ SYM53C500_probe(struct pcmcia_device *link)
859 return -ENOMEM; 859 return -ENOMEM;
860 info->p_dev = link; 860 info->p_dev = link;
861 link->priv = info; 861 link->priv = info;
862 link->io.NumPorts1 = 16; 862 link->resource[0]->end = 16;
863 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 863 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
864 link->io.IOAddrLines = 10;
865 link->conf.Attributes = CONF_ENABLE_IRQ; 864 link->conf.Attributes = CONF_ENABLE_IRQ;
866 link->conf.IntType = INT_MEMORY_AND_IO; 865 link->conf.IntType = INT_MEMORY_AND_IO;
867 866