aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pcmcia
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:21:06 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:21:06 -0500
commitfba395eee7d3f342ca739c20f5b3ee635d0420a0 (patch)
tree5a73f68d3514aa795b0d8c500e4d72170651d762 /drivers/scsi/pcmcia
parentfd238232cd0ff4840ae6946bb338502154096d88 (diff)
[PATCH] pcmcia: remove dev_link_t and client_handle_t indirection
dev_link_t * and client_handle_t both mean struct pcmcai_device * by now. Therefore, remove all such indirections. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/scsi/pcmcia')
-rw-r--r--drivers/scsi/pcmcia/aha152x_stub.c49
-rw-r--r--drivers/scsi/pcmcia/fdomain_stub.c46
-rw-r--r--drivers/scsi/pcmcia/nsp_cs.c50
-rw-r--r--drivers/scsi/pcmcia/nsp_cs.h6
-rw-r--r--drivers/scsi/pcmcia/qlogic_stub.c54
-rw-r--r--drivers/scsi/pcmcia/sym53c500_cs.c45
6 files changed, 111 insertions, 139 deletions
diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c
index 0c196fbb312..21c6b101453 100644
--- a/drivers/scsi/pcmcia/aha152x_stub.c
+++ b/drivers/scsi/pcmcia/aha152x_stub.c
@@ -94,24 +94,23 @@ typedef struct scsi_info_t {
94 struct Scsi_Host *host; 94 struct Scsi_Host *host;
95} scsi_info_t; 95} scsi_info_t;
96 96
97static void aha152x_release_cs(dev_link_t *link); 97static void aha152x_release_cs(struct pcmcia_device *link);
98static void aha152x_detach(struct pcmcia_device *p_dev); 98static void aha152x_detach(struct pcmcia_device *p_dev);
99static void aha152x_config_cs(dev_link_t *link); 99static void aha152x_config_cs(struct pcmcia_device *link);
100 100
101static dev_link_t *dev_list; 101static struct pcmcia_device *dev_list;
102 102
103static int aha152x_attach(struct pcmcia_device *p_dev) 103static int aha152x_attach(struct pcmcia_device *link)
104{ 104{
105 scsi_info_t *info; 105 scsi_info_t *info;
106 dev_link_t *link = dev_to_instance(p_dev); 106
107
108 DEBUG(0, "aha152x_attach()\n"); 107 DEBUG(0, "aha152x_attach()\n");
109 108
110 /* Create new SCSI device */ 109 /* Create new SCSI device */
111 info = kmalloc(sizeof(*info), GFP_KERNEL); 110 info = kmalloc(sizeof(*info), GFP_KERNEL);
112 if (!info) return -ENOMEM; 111 if (!info) return -ENOMEM;
113 memset(info, 0, sizeof(*info)); 112 memset(info, 0, sizeof(*info));
114 info->p_dev = p_dev; 113 info->p_dev = link;
115 link->priv = info; 114 link->priv = info;
116 115
117 link->io.NumPorts1 = 0x20; 116 link->io.NumPorts1 = 0x20;
@@ -131,10 +130,8 @@ static int aha152x_attach(struct pcmcia_device *p_dev)
131 130
132/*====================================================================*/ 131/*====================================================================*/
133 132
134static void aha152x_detach(struct pcmcia_device *p_dev) 133static void aha152x_detach(struct pcmcia_device *link)
135{ 134{
136 dev_link_t *link = dev_to_instance(p_dev);
137
138 DEBUG(0, "aha152x_detach(0x%p)\n", link); 135 DEBUG(0, "aha152x_detach(0x%p)\n", link);
139 136
140 if (link->state & DEV_CONFIG) 137 if (link->state & DEV_CONFIG)
@@ -149,9 +146,8 @@ static void aha152x_detach(struct pcmcia_device *p_dev)
149#define CS_CHECK(fn, ret) \ 146#define CS_CHECK(fn, ret) \
150do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 147do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
151 148
152static void aha152x_config_cs(dev_link_t *link) 149static void aha152x_config_cs(struct pcmcia_device *link)
153{ 150{
154 client_handle_t handle = link->handle;
155 scsi_info_t *info = link->priv; 151 scsi_info_t *info = link->priv;
156 struct aha152x_setup s; 152 struct aha152x_setup s;
157 tuple_t tuple; 153 tuple_t tuple;
@@ -166,19 +162,19 @@ static void aha152x_config_cs(dev_link_t *link)
166 tuple.TupleData = tuple_data; 162 tuple.TupleData = tuple_data;
167 tuple.TupleDataMax = 64; 163 tuple.TupleDataMax = 64;
168 tuple.TupleOffset = 0; 164 tuple.TupleOffset = 0;
169 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 165 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
170 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 166 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
171 CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 167 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
172 link->conf.ConfigBase = parse.config.base; 168 link->conf.ConfigBase = parse.config.base;
173 169
174 /* Configure card */ 170 /* Configure card */
175 link->state |= DEV_CONFIG; 171 link->state |= DEV_CONFIG;
176 172
177 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 173 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
178 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 174 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
179 while (1) { 175 while (1) {
180 if (pcmcia_get_tuple_data(handle, &tuple) != 0 || 176 if (pcmcia_get_tuple_data(link, &tuple) != 0 ||
181 pcmcia_parse_tuple(handle, &tuple, &parse) != 0) 177 pcmcia_parse_tuple(link, &tuple, &parse) != 0)
182 goto next_entry; 178 goto next_entry;
183 /* For New Media T&J, look for a SCSI window */ 179 /* For New Media T&J, look for a SCSI window */
184 if (parse.cftable_entry.io.win[0].len >= 0x20) 180 if (parse.cftable_entry.io.win[0].len >= 0x20)
@@ -189,15 +185,15 @@ static void aha152x_config_cs(dev_link_t *link)
189 if ((parse.cftable_entry.io.nwin > 0) && 185 if ((parse.cftable_entry.io.nwin > 0) &&
190 (link->io.BasePort1 < 0xffff)) { 186 (link->io.BasePort1 < 0xffff)) {
191 link->conf.ConfigIndex = parse.cftable_entry.index; 187 link->conf.ConfigIndex = parse.cftable_entry.index;
192 i = pcmcia_request_io(handle, &link->io); 188 i = pcmcia_request_io(link, &link->io);
193 if (i == CS_SUCCESS) break; 189 if (i == CS_SUCCESS) break;
194 } 190 }
195 next_entry: 191 next_entry:
196 CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple)); 192 CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple));
197 } 193 }
198 194
199 CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq)); 195 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
200 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf)); 196 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
201 197
202 /* Set configuration options for the aha152x driver */ 198 /* Set configuration options for the aha152x driver */
203 memset(&s, 0, sizeof(s)); 199 memset(&s, 0, sizeof(s));
@@ -226,22 +222,21 @@ static void aha152x_config_cs(dev_link_t *link)
226 return; 222 return;
227 223
228cs_failed: 224cs_failed:
229 cs_error(link->handle, last_fn, last_ret); 225 cs_error(link, last_fn, last_ret);
230 aha152x_release_cs(link); 226 aha152x_release_cs(link);
231 return; 227 return;
232} 228}
233 229
234static void aha152x_release_cs(dev_link_t *link) 230static void aha152x_release_cs(struct pcmcia_device *link)
235{ 231{
236 scsi_info_t *info = link->priv; 232 scsi_info_t *info = link->priv;
237 233
238 aha152x_release(info->host); 234 aha152x_release(info->host);
239 pcmcia_disable_device(link->handle); 235 pcmcia_disable_device(link);
240} 236}
241 237
242static int aha152x_resume(struct pcmcia_device *dev) 238static int aha152x_resume(struct pcmcia_device *link)
243{ 239{
244 dev_link_t *link = dev_to_instance(dev);
245 scsi_info_t *info = link->priv; 240 scsi_info_t *info = link->priv;
246 241
247 aha152x_host_reset_host(info->host); 242 aha152x_host_reset_host(info->host);
diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c
index 94dcee9f285..4e6927112c0 100644
--- a/drivers/scsi/pcmcia/fdomain_stub.c
+++ b/drivers/scsi/pcmcia/fdomain_stub.c
@@ -79,14 +79,13 @@ typedef struct scsi_info_t {
79} scsi_info_t; 79} scsi_info_t;
80 80
81 81
82static void fdomain_release(dev_link_t *link); 82static void fdomain_release(struct pcmcia_device *link);
83static void fdomain_detach(struct pcmcia_device *p_dev); 83static void fdomain_detach(struct pcmcia_device *p_dev);
84static void fdomain_config(dev_link_t *link); 84static void fdomain_config(struct pcmcia_device *link);
85 85
86static int fdomain_attach(struct pcmcia_device *p_dev) 86static int fdomain_attach(struct pcmcia_device *link)
87{ 87{
88 scsi_info_t *info; 88 scsi_info_t *info;
89 dev_link_t *link = dev_to_instance(p_dev);
90 89
91 DEBUG(0, "fdomain_attach()\n"); 90 DEBUG(0, "fdomain_attach()\n");
92 91
@@ -94,7 +93,7 @@ static int fdomain_attach(struct pcmcia_device *p_dev)
94 info = kmalloc(sizeof(*info), GFP_KERNEL); 93 info = kmalloc(sizeof(*info), GFP_KERNEL);
95 if (!info) return -ENOMEM; 94 if (!info) return -ENOMEM;
96 memset(info, 0, sizeof(*info)); 95 memset(info, 0, sizeof(*info));
97 info->p_dev = p_dev; 96 info->p_dev = link;
98 link->priv = info; 97 link->priv = info;
99 link->io.NumPorts1 = 0x10; 98 link->io.NumPorts1 = 0x10;
100 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 99 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
@@ -113,10 +112,8 @@ static int fdomain_attach(struct pcmcia_device *p_dev)
113 112
114/*====================================================================*/ 113/*====================================================================*/
115 114
116static void fdomain_detach(struct pcmcia_device *p_dev) 115static void fdomain_detach(struct pcmcia_device *link)
117{ 116{
118 dev_link_t *link = dev_to_instance(p_dev);
119
120 DEBUG(0, "fdomain_detach(0x%p)\n", link); 117 DEBUG(0, "fdomain_detach(0x%p)\n", link);
121 118
122 if (link->state & DEV_CONFIG) 119 if (link->state & DEV_CONFIG)
@@ -130,9 +127,8 @@ static void fdomain_detach(struct pcmcia_device *p_dev)
130#define CS_CHECK(fn, ret) \ 127#define CS_CHECK(fn, ret) \
131do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 128do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
132 129
133static void fdomain_config(dev_link_t *link) 130static void fdomain_config(struct pcmcia_device *link)
134{ 131{
135 client_handle_t handle = link->handle;
136 scsi_info_t *info = link->priv; 132 scsi_info_t *info = link->priv;
137 tuple_t tuple; 133 tuple_t tuple;
138 cisparse_t parse; 134 cisparse_t parse;
@@ -147,30 +143,30 @@ static void fdomain_config(dev_link_t *link)
147 tuple.TupleData = tuple_data; 143 tuple.TupleData = tuple_data;
148 tuple.TupleDataMax = 64; 144 tuple.TupleDataMax = 64;
149 tuple.TupleOffset = 0; 145 tuple.TupleOffset = 0;
150 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 146 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
151 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 147 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
152 CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 148 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
153 link->conf.ConfigBase = parse.config.base; 149 link->conf.ConfigBase = parse.config.base;
154 150
155 /* Configure card */ 151 /* Configure card */
156 link->state |= DEV_CONFIG; 152 link->state |= DEV_CONFIG;
157 153
158 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 154 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
159 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 155 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
160 while (1) { 156 while (1) {
161 if (pcmcia_get_tuple_data(handle, &tuple) != 0 || 157 if (pcmcia_get_tuple_data(link, &tuple) != 0 ||
162 pcmcia_parse_tuple(handle, &tuple, &parse) != 0) 158 pcmcia_parse_tuple(link, &tuple, &parse) != 0)
163 goto next_entry; 159 goto next_entry;
164 link->conf.ConfigIndex = parse.cftable_entry.index; 160 link->conf.ConfigIndex = parse.cftable_entry.index;
165 link->io.BasePort1 = parse.cftable_entry.io.win[0].base; 161 link->io.BasePort1 = parse.cftable_entry.io.win[0].base;
166 i = pcmcia_request_io(handle, &link->io); 162 i = pcmcia_request_io(link, &link->io);
167 if (i == CS_SUCCESS) break; 163 if (i == CS_SUCCESS) break;
168 next_entry: 164 next_entry:
169 CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple)); 165 CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple));
170 } 166 }
171 167
172 CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq)); 168 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
173 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf)); 169 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
174 170
175 /* A bad hack... */ 171 /* A bad hack... */
176 release_region(link->io.BasePort1, link->io.NumPorts1); 172 release_region(link->io.BasePort1, link->io.NumPorts1);
@@ -196,7 +192,7 @@ static void fdomain_config(dev_link_t *link)
196 return; 192 return;
197 193
198cs_failed: 194cs_failed:
199 cs_error(link->handle, last_fn, last_ret); 195 cs_error(link, last_fn, last_ret);
200 fdomain_release(link); 196 fdomain_release(link);
201 return; 197 return;
202 198
@@ -204,23 +200,21 @@ cs_failed:
204 200
205/*====================================================================*/ 201/*====================================================================*/
206 202
207static void fdomain_release(dev_link_t *link) 203static void fdomain_release(struct pcmcia_device *link)
208{ 204{
209 scsi_info_t *info = link->priv; 205 scsi_info_t *info = link->priv;
210 206
211 DEBUG(0, "fdomain_release(0x%p)\n", link); 207 DEBUG(0, "fdomain_release(0x%p)\n", link);
212 208
213 scsi_remove_host(info->host); 209 scsi_remove_host(info->host);
214 pcmcia_disable_device(link->handle); 210 pcmcia_disable_device(link);
215 scsi_unregister(info->host); 211 scsi_unregister(info->host);
216} 212}
217 213
218/*====================================================================*/ 214/*====================================================================*/
219 215
220static int fdomain_resume(struct pcmcia_device *dev) 216static int fdomain_resume(struct pcmcia_device *link)
221{ 217{
222 dev_link_t *link = dev_to_instance(dev);
223
224 if (link->state & DEV_CONFIG) 218 if (link->state & DEV_CONFIG)
225 fdomain_16x0_bus_reset(NULL); 219 fdomain_16x0_bus_reset(NULL);
226 220
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index 23548fbf489..ce4d7d868d2 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -1593,11 +1593,10 @@ static int nsp_eh_host_reset(Scsi_Cmnd *SCpnt)
1593 configure the card at this point -- we wait until we receive a 1593 configure the card at this point -- we wait until we receive a
1594 card insertion event. 1594 card insertion event.
1595======================================================================*/ 1595======================================================================*/
1596static int nsp_cs_attach(struct pcmcia_device *p_dev) 1596static int nsp_cs_attach(struct pcmcia_device *link)
1597{ 1597{
1598 scsi_info_t *info; 1598 scsi_info_t *info;
1599 nsp_hw_data *data = &nsp_data_base; 1599 nsp_hw_data *data = &nsp_data_base;
1600 dev_link_t *link = dev_to_instance(p_dev);
1601 1600
1602 nsp_dbg(NSP_DEBUG_INIT, "in"); 1601 nsp_dbg(NSP_DEBUG_INIT, "in");
1603 1602
@@ -1605,7 +1604,7 @@ static int nsp_cs_attach(struct pcmcia_device *p_dev)
1605 info = kmalloc(sizeof(*info), GFP_KERNEL); 1604 info = kmalloc(sizeof(*info), GFP_KERNEL);
1606 if (info == NULL) { return -ENOMEM; } 1605 if (info == NULL) { return -ENOMEM; }
1607 memset(info, 0, sizeof(*info)); 1606 memset(info, 0, sizeof(*info));
1608 info->p_dev = p_dev; 1607 info->p_dev = link;
1609 link->priv = info; 1608 link->priv = info;
1610 data->ScsiInfo = info; 1609 data->ScsiInfo = info;
1611 1610
@@ -1644,10 +1643,8 @@ static int nsp_cs_attach(struct pcmcia_device *p_dev)
1644 structures are freed. Otherwise, the structures will be freed 1643 structures are freed. Otherwise, the structures will be freed
1645 when the device is released. 1644 when the device is released.
1646======================================================================*/ 1645======================================================================*/
1647static void nsp_cs_detach(struct pcmcia_device *p_dev) 1646static void nsp_cs_detach(struct pcmcia_device *link)
1648{ 1647{
1649 dev_link_t *link = dev_to_instance(p_dev);
1650
1651 nsp_dbg(NSP_DEBUG_INIT, "in, link=0x%p", link); 1648 nsp_dbg(NSP_DEBUG_INIT, "in, link=0x%p", link);
1652 1649
1653 if (link->state & DEV_CONFIG) { 1650 if (link->state & DEV_CONFIG) {
@@ -1668,9 +1665,8 @@ static void nsp_cs_detach(struct pcmcia_device *p_dev)
1668#define CS_CHECK(fn, ret) \ 1665#define CS_CHECK(fn, ret) \
1669do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 1666do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
1670/*====================================================================*/ 1667/*====================================================================*/
1671static void nsp_cs_config(dev_link_t *link) 1668static void nsp_cs_config(struct pcmcia_device *link)
1672{ 1669{
1673 client_handle_t handle = link->handle;
1674 scsi_info_t *info = link->priv; 1670 scsi_info_t *info = link->priv;
1675 tuple_t tuple; 1671 tuple_t tuple;
1676 cisparse_t parse; 1672 cisparse_t parse;
@@ -1694,9 +1690,9 @@ static void nsp_cs_config(dev_link_t *link)
1694 tuple.TupleData = tuple_data; 1690 tuple.TupleData = tuple_data;
1695 tuple.TupleDataMax = sizeof(tuple_data); 1691 tuple.TupleDataMax = sizeof(tuple_data);
1696 tuple.TupleOffset = 0; 1692 tuple.TupleOffset = 0;
1697 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 1693 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
1698 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 1694 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
1699 CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 1695 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
1700 link->conf.ConfigBase = parse.config.base; 1696 link->conf.ConfigBase = parse.config.base;
1701 link->conf.Present = parse.config.rmask[0]; 1697 link->conf.Present = parse.config.rmask[0];
1702 1698
@@ -1704,15 +1700,15 @@ static void nsp_cs_config(dev_link_t *link)
1704 link->state |= DEV_CONFIG; 1700 link->state |= DEV_CONFIG;
1705 1701
1706 /* Look up the current Vcc */ 1702 /* Look up the current Vcc */
1707 CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(handle, &conf)); 1703 CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &conf));
1708 1704
1709 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 1705 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
1710 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 1706 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
1711 while (1) { 1707 while (1) {
1712 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry); 1708 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);
1713 1709
1714 if (pcmcia_get_tuple_data(handle, &tuple) != 0 || 1710 if (pcmcia_get_tuple_data(link, &tuple) != 0 ||
1715 pcmcia_parse_tuple(handle, &tuple, &parse) != 0) 1711 pcmcia_parse_tuple(link, &tuple, &parse) != 0)
1716 goto next_entry; 1712 goto next_entry;
1717 1713
1718 if (cfg->flags & CISTPL_CFTABLE_DEFAULT) { dflt = *cfg; } 1714 if (cfg->flags & CISTPL_CFTABLE_DEFAULT) { dflt = *cfg; }
@@ -1768,7 +1764,7 @@ static void nsp_cs_config(dev_link_t *link)
1768 link->io.NumPorts2 = io->win[1].len; 1764 link->io.NumPorts2 = io->win[1].len;
1769 } 1765 }
1770 /* This reserves IO space but doesn't actually enable it */ 1766 /* This reserves IO space but doesn't actually enable it */
1771 if (pcmcia_request_io(link->handle, &link->io) != 0) 1767 if (pcmcia_request_io(link, &link->io) != 0)
1772 goto next_entry; 1768 goto next_entry;
1773 } 1769 }
1774 1770
@@ -1783,7 +1779,7 @@ static void nsp_cs_config(dev_link_t *link)
1783 req.Size = 0x1000; 1779 req.Size = 0x1000;
1784 } 1780 }
1785 req.AccessSpeed = 0; 1781 req.AccessSpeed = 0;
1786 if (pcmcia_request_window(&link->handle, &req, &link->win) != 0) 1782 if (pcmcia_request_window(&link, &req, &link->win) != 0)
1787 goto next_entry; 1783 goto next_entry;
1788 map.Page = 0; map.CardOffset = mem->win[0].card_addr; 1784 map.Page = 0; map.CardOffset = mem->win[0].card_addr;
1789 if (pcmcia_map_mem_page(link->win, &map) != 0) 1785 if (pcmcia_map_mem_page(link->win, &map) != 0)
@@ -1797,14 +1793,14 @@ static void nsp_cs_config(dev_link_t *link)
1797 1793
1798 next_entry: 1794 next_entry:
1799 nsp_dbg(NSP_DEBUG_INIT, "next"); 1795 nsp_dbg(NSP_DEBUG_INIT, "next");
1800 pcmcia_disable_device(handle); 1796 pcmcia_disable_device(link);
1801 CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple)); 1797 CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple));
1802 } 1798 }
1803 1799
1804 if (link->conf.Attributes & CONF_ENABLE_IRQ) { 1800 if (link->conf.Attributes & CONF_ENABLE_IRQ) {
1805 CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq)); 1801 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
1806 } 1802 }
1807 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf)); 1803 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
1808 1804
1809 if (free_ports) { 1805 if (free_ports) {
1810 if (link->io.BasePort1) { 1806 if (link->io.BasePort1) {
@@ -1925,7 +1921,7 @@ static void nsp_cs_config(dev_link_t *link)
1925 1921
1926 cs_failed: 1922 cs_failed:
1927 nsp_dbg(NSP_DEBUG_INIT, "config fail"); 1923 nsp_dbg(NSP_DEBUG_INIT, "config fail");
1928 cs_error(link->handle, last_fn, last_ret); 1924 cs_error(link, last_fn, last_ret);
1929 nsp_cs_release(link); 1925 nsp_cs_release(link);
1930 1926
1931 return; 1927 return;
@@ -1938,7 +1934,7 @@ static void nsp_cs_config(dev_link_t *link)
1938 device, and release the PCMCIA configuration. If the device is 1934 device, and release the PCMCIA configuration. If the device is
1939 still open, this will be postponed until it is closed. 1935 still open, this will be postponed until it is closed.
1940======================================================================*/ 1936======================================================================*/
1941static void nsp_cs_release(dev_link_t *link) 1937static void nsp_cs_release(struct pcmcia_device *link)
1942{ 1938{
1943 scsi_info_t *info = link->priv; 1939 scsi_info_t *info = link->priv;
1944 nsp_hw_data *data = NULL; 1940 nsp_hw_data *data = NULL;
@@ -1966,7 +1962,7 @@ static void nsp_cs_release(dev_link_t *link)
1966 iounmap((void *)(data->MmioAddress)); 1962 iounmap((void *)(data->MmioAddress));
1967 } 1963 }
1968 } 1964 }
1969 pcmcia_disable_device(link->handle); 1965 pcmcia_disable_device(link);
1970 1966
1971#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,2)) 1967#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,2))
1972 if (info->host != NULL) { 1968 if (info->host != NULL) {
@@ -1975,9 +1971,8 @@ static void nsp_cs_release(dev_link_t *link)
1975#endif 1971#endif
1976} /* nsp_cs_release */ 1972} /* nsp_cs_release */
1977 1973
1978static int nsp_cs_suspend(struct pcmcia_device *dev) 1974static int nsp_cs_suspend(struct pcmcia_device *link)
1979{ 1975{
1980 dev_link_t *link = dev_to_instance(dev);
1981 scsi_info_t *info = link->priv; 1976 scsi_info_t *info = link->priv;
1982 nsp_hw_data *data; 1977 nsp_hw_data *data;
1983 1978
@@ -1996,9 +1991,8 @@ static int nsp_cs_suspend(struct pcmcia_device *dev)
1996 return 0; 1991 return 0;
1997} 1992}
1998 1993
1999static int nsp_cs_resume(struct pcmcia_device *dev) 1994static int nsp_cs_resume(struct pcmcia_device *link)
2000{ 1995{
2001 dev_link_t *link = dev_to_instance(dev);
2002 scsi_info_t *info = link->priv; 1996 scsi_info_t *info = link->priv;
2003 nsp_hw_data *data; 1997 nsp_hw_data *data;
2004 1998
diff --git a/drivers/scsi/pcmcia/nsp_cs.h b/drivers/scsi/pcmcia/nsp_cs.h
index 2e1fde467c2..ce348b379f2 100644
--- a/drivers/scsi/pcmcia/nsp_cs.h
+++ b/drivers/scsi/pcmcia/nsp_cs.h
@@ -297,8 +297,8 @@ typedef struct _nsp_hw_data {
297 297
298/* Card service functions */ 298/* Card service functions */
299static void nsp_cs_detach (struct pcmcia_device *p_dev); 299static void nsp_cs_detach (struct pcmcia_device *p_dev);
300static void nsp_cs_release(dev_link_t *link); 300static void nsp_cs_release(struct pcmcia_device *link);
301static void nsp_cs_config (dev_link_t *link); 301static void nsp_cs_config (struct pcmcia_device *link);
302 302
303/* Linux SCSI subsystem specific functions */ 303/* Linux SCSI subsystem specific functions */
304static struct Scsi_Host *nsp_detect (struct scsi_host_template *sht); 304static struct Scsi_Host *nsp_detect (struct scsi_host_template *sht);
@@ -450,7 +450,7 @@ static inline struct Scsi_Host *scsi_host_hn_get(unsigned short hostno)
450 return host; 450 return host;
451} 451}
452 452
453static void cs_error(client_handle_t handle, int func, int ret) 453static void cs_error(struct pcmcia_device *handle, int func, int ret)
454{ 454{
455 error_info_t err = { func, ret }; 455 error_info_t err = { func, ret };
456 pcmcia_report_error(handle, &err); 456 pcmcia_report_error(handle, &err);
diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c
index c6b3e9587ff..a2a1c4b318e 100644
--- a/drivers/scsi/pcmcia/qlogic_stub.c
+++ b/drivers/scsi/pcmcia/qlogic_stub.c
@@ -97,12 +97,12 @@ typedef struct scsi_info_t {
97 unsigned short manf_id; 97 unsigned short manf_id;
98} scsi_info_t; 98} scsi_info_t;
99 99
100static void qlogic_release(dev_link_t *link); 100static void qlogic_release(struct pcmcia_device *link);
101static void qlogic_detach(struct pcmcia_device *p_dev); 101static void qlogic_detach(struct pcmcia_device *p_dev);
102static void qlogic_config(dev_link_t * link); 102static void qlogic_config(struct pcmcia_device * link);
103 103
104static struct Scsi_Host *qlogic_detect(struct scsi_host_template *host, 104static struct Scsi_Host *qlogic_detect(struct scsi_host_template *host,
105 dev_link_t *link, int qbase, int qlirq) 105 struct pcmcia_device *link, int qbase, int qlirq)
106{ 106{
107 int qltyp; /* type of chip */ 107 int qltyp; /* type of chip */
108 int qinitid; 108 int qinitid;
@@ -156,10 +156,9 @@ free_scsi_host:
156err: 156err:
157 return NULL; 157 return NULL;
158} 158}
159static int qlogic_attach(struct pcmcia_device *p_dev) 159static int qlogic_attach(struct pcmcia_device *link)
160{ 160{
161 scsi_info_t *info; 161 scsi_info_t *info;
162 dev_link_t *link = dev_to_instance(p_dev);
163 162
164 DEBUG(0, "qlogic_attach()\n"); 163 DEBUG(0, "qlogic_attach()\n");
165 164
@@ -168,7 +167,7 @@ static int qlogic_attach(struct pcmcia_device *p_dev)
168 if (!info) 167 if (!info)
169 return -ENOMEM; 168 return -ENOMEM;
170 memset(info, 0, sizeof(*info)); 169 memset(info, 0, sizeof(*info));
171 info->p_dev = p_dev; 170 info->p_dev = link;
172 link->priv = info; 171 link->priv = info;
173 link->io.NumPorts1 = 16; 172 link->io.NumPorts1 = 16;
174 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 173 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
@@ -187,10 +186,8 @@ static int qlogic_attach(struct pcmcia_device *p_dev)
187 186
188/*====================================================================*/ 187/*====================================================================*/
189 188
190static void qlogic_detach(struct pcmcia_device *p_dev) 189static void qlogic_detach(struct pcmcia_device *link)
191{ 190{
192 dev_link_t *link = dev_to_instance(p_dev);
193
194 DEBUG(0, "qlogic_detach(0x%p)\n", link); 191 DEBUG(0, "qlogic_detach(0x%p)\n", link);
195 192
196 if (link->state & DEV_CONFIG) 193 if (link->state & DEV_CONFIG)
@@ -205,9 +202,8 @@ static void qlogic_detach(struct pcmcia_device *p_dev)
205#define CS_CHECK(fn, ret) \ 202#define CS_CHECK(fn, ret) \
206do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 203do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
207 204
208static void qlogic_config(dev_link_t * link) 205static void qlogic_config(struct pcmcia_device * link)
209{ 206{
210 client_handle_t handle = link->handle;
211 scsi_info_t *info = link->priv; 207 scsi_info_t *info = link->priv;
212 tuple_t tuple; 208 tuple_t tuple;
213 cisparse_t parse; 209 cisparse_t parse;
@@ -221,38 +217,38 @@ static void qlogic_config(dev_link_t * link)
221 tuple.TupleDataMax = 64; 217 tuple.TupleDataMax = 64;
222 tuple.TupleOffset = 0; 218 tuple.TupleOffset = 0;
223 tuple.DesiredTuple = CISTPL_CONFIG; 219 tuple.DesiredTuple = CISTPL_CONFIG;
224 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 220 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
225 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 221 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
226 CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 222 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
227 link->conf.ConfigBase = parse.config.base; 223 link->conf.ConfigBase = parse.config.base;
228 224
229 tuple.DesiredTuple = CISTPL_MANFID; 225 tuple.DesiredTuple = CISTPL_MANFID;
230 if ((pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS) && (pcmcia_get_tuple_data(handle, &tuple) == CS_SUCCESS)) 226 if ((pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) && (pcmcia_get_tuple_data(link, &tuple) == CS_SUCCESS))
231 info->manf_id = le16_to_cpu(tuple.TupleData[0]); 227 info->manf_id = le16_to_cpu(tuple.TupleData[0]);
232 228
233 /* Configure card */ 229 /* Configure card */
234 link->state |= DEV_CONFIG; 230 link->state |= DEV_CONFIG;
235 231
236 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 232 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
237 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 233 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
238 while (1) { 234 while (1) {
239 if (pcmcia_get_tuple_data(handle, &tuple) != 0 || 235 if (pcmcia_get_tuple_data(link, &tuple) != 0 ||
240 pcmcia_parse_tuple(handle, &tuple, &parse) != 0) 236 pcmcia_parse_tuple(link, &tuple, &parse) != 0)
241 goto next_entry; 237 goto next_entry;
242 link->conf.ConfigIndex = parse.cftable_entry.index; 238 link->conf.ConfigIndex = parse.cftable_entry.index;
243 link->io.BasePort1 = parse.cftable_entry.io.win[0].base; 239 link->io.BasePort1 = parse.cftable_entry.io.win[0].base;
244 link->io.NumPorts1 = parse.cftable_entry.io.win[0].len; 240 link->io.NumPorts1 = parse.cftable_entry.io.win[0].len;
245 if (link->io.BasePort1 != 0) { 241 if (link->io.BasePort1 != 0) {
246 i = pcmcia_request_io(handle, &link->io); 242 i = pcmcia_request_io(link, &link->io);
247 if (i == CS_SUCCESS) 243 if (i == CS_SUCCESS)
248 break; 244 break;
249 } 245 }
250 next_entry: 246 next_entry:
251 CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple)); 247 CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple));
252 } 248 }
253 249
254 CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq)); 250 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
255 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf)); 251 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
256 252
257 if ((info->manf_id == MANFID_MACNICA) || (info->manf_id == MANFID_PIONEER) || (info->manf_id == 0x0098)) { 253 if ((info->manf_id == MANFID_MACNICA) || (info->manf_id == MANFID_PIONEER) || (info->manf_id == 0x0098)) {
258 /* set ATAcmd */ 254 /* set ATAcmd */
@@ -283,15 +279,15 @@ out:
283 return; 279 return;
284 280
285cs_failed: 281cs_failed:
286 cs_error(link->handle, last_fn, last_ret); 282 cs_error(link, last_fn, last_ret);
287 pcmcia_disable_device(link->handle); 283 pcmcia_disable_device(link);
288 return; 284 return;
289 285
290} /* qlogic_config */ 286} /* qlogic_config */
291 287
292/*====================================================================*/ 288/*====================================================================*/
293 289
294static void qlogic_release(dev_link_t *link) 290static void qlogic_release(struct pcmcia_device *link)
295{ 291{
296 scsi_info_t *info = link->priv; 292 scsi_info_t *info = link->priv;
297 293
@@ -300,21 +296,19 @@ static void qlogic_release(dev_link_t *link)
300 scsi_remove_host(info->host); 296 scsi_remove_host(info->host);
301 297
302 free_irq(link->irq.AssignedIRQ, info->host); 298 free_irq(link->irq.AssignedIRQ, info->host);
303 pcmcia_disable_device(link->handle); 299 pcmcia_disable_device(link);
304 300
305 scsi_host_put(info->host); 301 scsi_host_put(info->host);
306} 302}
307 303
308/*====================================================================*/ 304/*====================================================================*/
309 305
310static int qlogic_resume(struct pcmcia_device *dev) 306static int qlogic_resume(struct pcmcia_device *link)
311{ 307{
312 dev_link_t *link = dev_to_instance(dev);
313
314 if (link->state & DEV_CONFIG) { 308 if (link->state & DEV_CONFIG) {
315 scsi_info_t *info = link->priv; 309 scsi_info_t *info = link->priv;
316 310
317 pcmcia_request_configuration(link->handle, &link->conf); 311 pcmcia_request_configuration(link, &link->conf);
318 if ((info->manf_id == MANFID_MACNICA) || 312 if ((info->manf_id == MANFID_MACNICA) ||
319 (info->manf_id == MANFID_PIONEER) || 313 (info->manf_id == MANFID_PIONEER) ||
320 (info->manf_id == 0x0098)) { 314 (info->manf_id == 0x0098)) {
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c
index 1ef3109418c..49a37de6875 100644
--- a/drivers/scsi/pcmcia/sym53c500_cs.c
+++ b/drivers/scsi/pcmcia/sym53c500_cs.c
@@ -527,7 +527,7 @@ idle_out:
527} 527}
528 528
529static void 529static void
530SYM53C500_release(dev_link_t *link) 530SYM53C500_release(struct pcmcia_device *link)
531{ 531{
532 struct scsi_info_t *info = link->priv; 532 struct scsi_info_t *info = link->priv;
533 struct Scsi_Host *shost = info->host; 533 struct Scsi_Host *shost = info->host;
@@ -550,7 +550,7 @@ SYM53C500_release(dev_link_t *link)
550 if (shost->io_port && shost->n_io_port) 550 if (shost->io_port && shost->n_io_port)
551 release_region(shost->io_port, shost->n_io_port); 551 release_region(shost->io_port, shost->n_io_port);
552 552
553 pcmcia_disable_device(link->handle); 553 pcmcia_disable_device(link);
554 554
555 scsi_host_put(shost); 555 scsi_host_put(shost);
556} /* SYM53C500_release */ 556} /* SYM53C500_release */
@@ -708,9 +708,8 @@ static struct scsi_host_template sym53c500_driver_template = {
708do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 708do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
709 709
710static void 710static void
711SYM53C500_config(dev_link_t *link) 711SYM53C500_config(struct pcmcia_device *link)
712{ 712{
713 client_handle_t handle = link->handle;
714 struct scsi_info_t *info = link->priv; 713 struct scsi_info_t *info = link->priv;
715 tuple_t tuple; 714 tuple_t tuple;
716 cisparse_t parse; 715 cisparse_t parse;
@@ -727,40 +726,40 @@ SYM53C500_config(dev_link_t *link)
727 tuple.TupleDataMax = 64; 726 tuple.TupleDataMax = 64;
728 tuple.TupleOffset = 0; 727 tuple.TupleOffset = 0;
729 tuple.DesiredTuple = CISTPL_CONFIG; 728 tuple.DesiredTuple = CISTPL_CONFIG;
730 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 729 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
731 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 730 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
732 CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 731 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
733 link->conf.ConfigBase = parse.config.base; 732 link->conf.ConfigBase = parse.config.base;
734 733
735 tuple.DesiredTuple = CISTPL_MANFID; 734 tuple.DesiredTuple = CISTPL_MANFID;
736 if ((pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS) && 735 if ((pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) &&
737 (pcmcia_get_tuple_data(handle, &tuple) == CS_SUCCESS)) 736 (pcmcia_get_tuple_data(link, &tuple) == CS_SUCCESS))
738 info->manf_id = le16_to_cpu(tuple.TupleData[0]); 737 info->manf_id = le16_to_cpu(tuple.TupleData[0]);
739 738
740 /* Configure card */ 739 /* Configure card */
741 link->state |= DEV_CONFIG; 740 link->state |= DEV_CONFIG;
742 741
743 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 742 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
744 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 743 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
745 while (1) { 744 while (1) {
746 if (pcmcia_get_tuple_data(handle, &tuple) != 0 || 745 if (pcmcia_get_tuple_data(link, &tuple) != 0 ||
747 pcmcia_parse_tuple(handle, &tuple, &parse) != 0) 746 pcmcia_parse_tuple(link, &tuple, &parse) != 0)
748 goto next_entry; 747 goto next_entry;
749 link->conf.ConfigIndex = parse.cftable_entry.index; 748 link->conf.ConfigIndex = parse.cftable_entry.index;
750 link->io.BasePort1 = parse.cftable_entry.io.win[0].base; 749 link->io.BasePort1 = parse.cftable_entry.io.win[0].base;
751 link->io.NumPorts1 = parse.cftable_entry.io.win[0].len; 750 link->io.NumPorts1 = parse.cftable_entry.io.win[0].len;
752 751
753 if (link->io.BasePort1 != 0) { 752 if (link->io.BasePort1 != 0) {
754 i = pcmcia_request_io(handle, &link->io); 753 i = pcmcia_request_io(link, &link->io);
755 if (i == CS_SUCCESS) 754 if (i == CS_SUCCESS)
756 break; 755 break;
757 } 756 }
758next_entry: 757next_entry:
759 CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple)); 758 CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple));
760 } 759 }
761 760
762 CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq)); 761 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
763 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf)); 762 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
764 763
765 /* 764 /*
766 * That's the trouble with copying liberally from another driver. 765 * That's the trouble with copying liberally from another driver.
@@ -852,14 +851,13 @@ out:
852 return; 851 return;
853 852
854cs_failed: 853cs_failed:
855 cs_error(link->handle, last_fn, last_ret); 854 cs_error(link, last_fn, last_ret);
856 SYM53C500_release(link); 855 SYM53C500_release(link);
857 return; 856 return;
858} /* SYM53C500_config */ 857} /* SYM53C500_config */
859 858
860static int sym53c500_resume(struct pcmcia_device *dev) 859static int sym53c500_resume(struct pcmcia_device *link)
861{ 860{
862 dev_link_t *link = dev_to_instance(dev);
863 struct scsi_info_t *info = link->priv; 861 struct scsi_info_t *info = link->priv;
864 862
865 if (link->state & DEV_CONFIG) { 863 if (link->state & DEV_CONFIG) {
@@ -882,10 +880,8 @@ static int sym53c500_resume(struct pcmcia_device *dev)
882} 880}
883 881
884static void 882static void
885SYM53C500_detach(struct pcmcia_device *p_dev) 883SYM53C500_detach(struct pcmcia_device *link)
886{ 884{
887 dev_link_t *link = dev_to_instance(p_dev);
888
889 DEBUG(0, "SYM53C500_detach(0x%p)\n", link); 885 DEBUG(0, "SYM53C500_detach(0x%p)\n", link);
890 886
891 if (link->state & DEV_CONFIG) 887 if (link->state & DEV_CONFIG)
@@ -896,10 +892,9 @@ SYM53C500_detach(struct pcmcia_device *p_dev)
896} /* SYM53C500_detach */ 892} /* SYM53C500_detach */
897 893
898static int 894static int
899SYM53C500_attach(struct pcmcia_device *p_dev) 895SYM53C500_attach(struct pcmcia_device *link)
900{ 896{
901 struct scsi_info_t *info; 897 struct scsi_info_t *info;
902 dev_link_t *link = dev_to_instance(p_dev);
903 898
904 DEBUG(0, "SYM53C500_attach()\n"); 899 DEBUG(0, "SYM53C500_attach()\n");
905 900
@@ -908,7 +903,7 @@ SYM53C500_attach(struct pcmcia_device *p_dev)
908 if (!info) 903 if (!info)
909 return -ENOMEM; 904 return -ENOMEM;
910 memset(info, 0, sizeof(*info)); 905 memset(info, 0, sizeof(*info));
911 info->p_dev = p_dev; 906 info->p_dev = link;
912 link->priv = info; 907 link->priv = info;
913 link->io.NumPorts1 = 16; 908 link->io.NumPorts1 = 16;
914 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 909 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;