diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 10:21:06 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 10:21:06 -0500 |
commit | fba395eee7d3f342ca739c20f5b3ee635d0420a0 (patch) | |
tree | 5a73f68d3514aa795b0d8c500e4d72170651d762 /drivers/isdn/hisax/elsa_cs.c | |
parent | fd238232cd0ff4840ae6946bb338502154096d88 (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/isdn/hisax/elsa_cs.c')
-rw-r--r-- | drivers/isdn/hisax/elsa_cs.c | 50 |
1 files changed, 22 insertions, 28 deletions
diff --git a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c index bcda675e9103..7a42bd43162f 100644 --- a/drivers/isdn/hisax/elsa_cs.c +++ b/drivers/isdn/hisax/elsa_cs.c | |||
@@ -94,8 +94,8 @@ module_param(protocol, int, 0); | |||
94 | handler. | 94 | handler. |
95 | */ | 95 | */ |
96 | 96 | ||
97 | static void elsa_cs_config(dev_link_t *link); | 97 | static void elsa_cs_config(struct pcmcia_device *link); |
98 | static void elsa_cs_release(dev_link_t *link); | 98 | static void elsa_cs_release(struct pcmcia_device *link); |
99 | 99 | ||
100 | /* | 100 | /* |
101 | The attach() and detach() entry points are used to create and destroy | 101 | The attach() and detach() entry points are used to create and destroy |
@@ -111,7 +111,7 @@ static void elsa_cs_detach(struct pcmcia_device *p_dev); | |||
111 | example, ethernet cards, modems). In other cases, there may be | 111 | example, ethernet cards, modems). In other cases, there may be |
112 | many actual or logical devices (SCSI adapters, memory cards with | 112 | many actual or logical devices (SCSI adapters, memory cards with |
113 | multiple partitions). The dev_node_t structures need to be kept | 113 | multiple partitions). The dev_node_t structures need to be kept |
114 | in a linked list starting at the 'dev' field of a dev_link_t | 114 | in a linked list starting at the 'dev' field of a struct pcmcia_device |
115 | structure. We allocate them in the card's private data structure, | 115 | structure. We allocate them in the card's private data structure, |
116 | because they generally shouldn't be allocated dynamically. | 116 | because they generally shouldn't be allocated dynamically. |
117 | In this case, we also provide a flag to indicate if a device is | 117 | In this case, we also provide a flag to indicate if a device is |
@@ -139,10 +139,9 @@ typedef struct local_info_t { | |||
139 | 139 | ||
140 | ======================================================================*/ | 140 | ======================================================================*/ |
141 | 141 | ||
142 | static int elsa_cs_attach(struct pcmcia_device *p_dev) | 142 | static int elsa_cs_attach(struct pcmcia_device *link) |
143 | { | 143 | { |
144 | local_info_t *local; | 144 | local_info_t *local; |
145 | dev_link_t *link = dev_to_instance(p_dev); | ||
146 | 145 | ||
147 | DEBUG(0, "elsa_cs_attach()\n"); | 146 | DEBUG(0, "elsa_cs_attach()\n"); |
148 | 147 | ||
@@ -151,7 +150,7 @@ static int elsa_cs_attach(struct pcmcia_device *p_dev) | |||
151 | if (!local) return -ENOMEM; | 150 | if (!local) return -ENOMEM; |
152 | memset(local, 0, sizeof(local_info_t)); | 151 | memset(local, 0, sizeof(local_info_t)); |
153 | 152 | ||
154 | local->p_dev = p_dev; | 153 | local->p_dev = link; |
155 | link->priv = local; | 154 | link->priv = local; |
156 | 155 | ||
157 | local->cardnr = -1; | 156 | local->cardnr = -1; |
@@ -190,9 +189,8 @@ static int elsa_cs_attach(struct pcmcia_device *p_dev) | |||
190 | 189 | ||
191 | ======================================================================*/ | 190 | ======================================================================*/ |
192 | 191 | ||
193 | static void elsa_cs_detach(struct pcmcia_device *p_dev) | 192 | static void elsa_cs_detach(struct pcmcia_device *link) |
194 | { | 193 | { |
195 | dev_link_t *link = dev_to_instance(p_dev); | ||
196 | local_info_t *info = link->priv; | 194 | local_info_t *info = link->priv; |
197 | 195 | ||
198 | DEBUG(0, "elsa_cs_detach(0x%p)\n", link); | 196 | DEBUG(0, "elsa_cs_detach(0x%p)\n", link); |
@@ -213,7 +211,7 @@ static void elsa_cs_detach(struct pcmcia_device *p_dev) | |||
213 | device available to the system. | 211 | device available to the system. |
214 | 212 | ||
215 | ======================================================================*/ | 213 | ======================================================================*/ |
216 | static int get_tuple(client_handle_t handle, tuple_t *tuple, | 214 | static int get_tuple(struct pcmcia_device *handle, tuple_t *tuple, |
217 | cisparse_t *parse) | 215 | cisparse_t *parse) |
218 | { | 216 | { |
219 | int i = pcmcia_get_tuple_data(handle, tuple); | 217 | int i = pcmcia_get_tuple_data(handle, tuple); |
@@ -221,7 +219,7 @@ static int get_tuple(client_handle_t handle, tuple_t *tuple, | |||
221 | return pcmcia_parse_tuple(handle, tuple, parse); | 219 | return pcmcia_parse_tuple(handle, tuple, parse); |
222 | } | 220 | } |
223 | 221 | ||
224 | static int first_tuple(client_handle_t handle, tuple_t *tuple, | 222 | static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple, |
225 | cisparse_t *parse) | 223 | cisparse_t *parse) |
226 | { | 224 | { |
227 | int i = pcmcia_get_first_tuple(handle, tuple); | 225 | int i = pcmcia_get_first_tuple(handle, tuple); |
@@ -229,7 +227,7 @@ static int first_tuple(client_handle_t handle, tuple_t *tuple, | |||
229 | return get_tuple(handle, tuple, parse); | 227 | return get_tuple(handle, tuple, parse); |
230 | } | 228 | } |
231 | 229 | ||
232 | static int next_tuple(client_handle_t handle, tuple_t *tuple, | 230 | static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, |
233 | cisparse_t *parse) | 231 | cisparse_t *parse) |
234 | { | 232 | { |
235 | int i = pcmcia_get_next_tuple(handle, tuple); | 233 | int i = pcmcia_get_next_tuple(handle, tuple); |
@@ -237,9 +235,8 @@ static int next_tuple(client_handle_t handle, tuple_t *tuple, | |||
237 | return get_tuple(handle, tuple, parse); | 235 | return get_tuple(handle, tuple, parse); |
238 | } | 236 | } |
239 | 237 | ||
240 | static void elsa_cs_config(dev_link_t *link) | 238 | static void elsa_cs_config(struct pcmcia_device *link) |
241 | { | 239 | { |
242 | client_handle_t handle; | ||
243 | tuple_t tuple; | 240 | tuple_t tuple; |
244 | cisparse_t parse; | 241 | cisparse_t parse; |
245 | local_info_t *dev; | 242 | local_info_t *dev; |
@@ -249,7 +246,6 @@ static void elsa_cs_config(dev_link_t *link) | |||
249 | IsdnCard_t icard; | 246 | IsdnCard_t icard; |
250 | 247 | ||
251 | DEBUG(0, "elsa_config(0x%p)\n", link); | 248 | DEBUG(0, "elsa_config(0x%p)\n", link); |
252 | handle = link->handle; | ||
253 | dev = link->priv; | 249 | dev = link->priv; |
254 | 250 | ||
255 | /* | 251 | /* |
@@ -261,7 +257,7 @@ static void elsa_cs_config(dev_link_t *link) | |||
261 | tuple.TupleDataMax = 255; | 257 | tuple.TupleDataMax = 255; |
262 | tuple.TupleOffset = 0; | 258 | tuple.TupleOffset = 0; |
263 | tuple.Attributes = 0; | 259 | tuple.Attributes = 0; |
264 | i = first_tuple(handle, &tuple, &parse); | 260 | i = first_tuple(link, &tuple, &parse); |
265 | if (i != CS_SUCCESS) { | 261 | if (i != CS_SUCCESS) { |
266 | last_fn = ParseTuple; | 262 | last_fn = ParseTuple; |
267 | goto cs_failed; | 263 | goto cs_failed; |
@@ -276,25 +272,25 @@ static void elsa_cs_config(dev_link_t *link) | |||
276 | tuple.TupleOffset = 0; tuple.TupleDataMax = 255; | 272 | tuple.TupleOffset = 0; tuple.TupleDataMax = 255; |
277 | tuple.Attributes = 0; | 273 | tuple.Attributes = 0; |
278 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | 274 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; |
279 | i = first_tuple(handle, &tuple, &parse); | 275 | i = first_tuple(link, &tuple, &parse); |
280 | while (i == CS_SUCCESS) { | 276 | while (i == CS_SUCCESS) { |
281 | if ( (cf->io.nwin > 0) && cf->io.win[0].base) { | 277 | if ( (cf->io.nwin > 0) && cf->io.win[0].base) { |
282 | printk(KERN_INFO "(elsa_cs: looks like the 96 model)\n"); | 278 | printk(KERN_INFO "(elsa_cs: looks like the 96 model)\n"); |
283 | link->conf.ConfigIndex = cf->index; | 279 | link->conf.ConfigIndex = cf->index; |
284 | link->io.BasePort1 = cf->io.win[0].base; | 280 | link->io.BasePort1 = cf->io.win[0].base; |
285 | i = pcmcia_request_io(link->handle, &link->io); | 281 | i = pcmcia_request_io(link, &link->io); |
286 | if (i == CS_SUCCESS) break; | 282 | if (i == CS_SUCCESS) break; |
287 | } else { | 283 | } else { |
288 | printk(KERN_INFO "(elsa_cs: looks like the 97 model)\n"); | 284 | printk(KERN_INFO "(elsa_cs: looks like the 97 model)\n"); |
289 | link->conf.ConfigIndex = cf->index; | 285 | link->conf.ConfigIndex = cf->index; |
290 | for (i = 0, j = 0x2f0; j > 0x100; j -= 0x10) { | 286 | for (i = 0, j = 0x2f0; j > 0x100; j -= 0x10) { |
291 | link->io.BasePort1 = j; | 287 | link->io.BasePort1 = j; |
292 | i = pcmcia_request_io(link->handle, &link->io); | 288 | i = pcmcia_request_io(link, &link->io); |
293 | if (i == CS_SUCCESS) break; | 289 | if (i == CS_SUCCESS) break; |
294 | } | 290 | } |
295 | break; | 291 | break; |
296 | } | 292 | } |
297 | i = next_tuple(handle, &tuple, &parse); | 293 | i = next_tuple(link, &tuple, &parse); |
298 | } | 294 | } |
299 | 295 | ||
300 | if (i != CS_SUCCESS) { | 296 | if (i != CS_SUCCESS) { |
@@ -302,14 +298,14 @@ static void elsa_cs_config(dev_link_t *link) | |||
302 | goto cs_failed; | 298 | goto cs_failed; |
303 | } | 299 | } |
304 | 300 | ||
305 | i = pcmcia_request_irq(link->handle, &link->irq); | 301 | i = pcmcia_request_irq(link, &link->irq); |
306 | if (i != CS_SUCCESS) { | 302 | if (i != CS_SUCCESS) { |
307 | link->irq.AssignedIRQ = 0; | 303 | link->irq.AssignedIRQ = 0; |
308 | last_fn = RequestIRQ; | 304 | last_fn = RequestIRQ; |
309 | goto cs_failed; | 305 | goto cs_failed; |
310 | } | 306 | } |
311 | 307 | ||
312 | i = pcmcia_request_configuration(link->handle, &link->conf); | 308 | i = pcmcia_request_configuration(link, &link->conf); |
313 | if (i != CS_SUCCESS) { | 309 | if (i != CS_SUCCESS) { |
314 | last_fn = RequestConfiguration; | 310 | last_fn = RequestConfiguration; |
315 | goto cs_failed; | 311 | goto cs_failed; |
@@ -352,7 +348,7 @@ static void elsa_cs_config(dev_link_t *link) | |||
352 | 348 | ||
353 | return; | 349 | return; |
354 | cs_failed: | 350 | cs_failed: |
355 | cs_error(link->handle, last_fn, i); | 351 | cs_error(link, last_fn, i); |
356 | elsa_cs_release(link); | 352 | elsa_cs_release(link); |
357 | } /* elsa_cs_config */ | 353 | } /* elsa_cs_config */ |
358 | 354 | ||
@@ -364,7 +360,7 @@ cs_failed: | |||
364 | 360 | ||
365 | ======================================================================*/ | 361 | ======================================================================*/ |
366 | 362 | ||
367 | static void elsa_cs_release(dev_link_t *link) | 363 | static void elsa_cs_release(struct pcmcia_device *link) |
368 | { | 364 | { |
369 | local_info_t *local = link->priv; | 365 | local_info_t *local = link->priv; |
370 | 366 | ||
@@ -377,12 +373,11 @@ static void elsa_cs_release(dev_link_t *link) | |||
377 | } | 373 | } |
378 | } | 374 | } |
379 | 375 | ||
380 | pcmcia_disable_device(link->handle); | 376 | pcmcia_disable_device(link); |
381 | } /* elsa_cs_release */ | 377 | } /* elsa_cs_release */ |
382 | 378 | ||
383 | static int elsa_suspend(struct pcmcia_device *p_dev) | 379 | static int elsa_suspend(struct pcmcia_device *link) |
384 | { | 380 | { |
385 | dev_link_t *link = dev_to_instance(p_dev); | ||
386 | local_info_t *dev = link->priv; | 381 | local_info_t *dev = link->priv; |
387 | 382 | ||
388 | dev->busy = 1; | 383 | dev->busy = 1; |
@@ -390,9 +385,8 @@ static int elsa_suspend(struct pcmcia_device *p_dev) | |||
390 | return 0; | 385 | return 0; |
391 | } | 386 | } |
392 | 387 | ||
393 | static int elsa_resume(struct pcmcia_device *p_dev) | 388 | static int elsa_resume(struct pcmcia_device *link) |
394 | { | 389 | { |
395 | dev_link_t *link = dev_to_instance(p_dev); | ||
396 | local_info_t *dev = link->priv; | 390 | local_info_t *dev = link->priv; |
397 | 391 | ||
398 | dev->busy = 0; | 392 | dev->busy = 0; |