aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hisax/avma1_cs.c
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/isdn/hisax/avma1_cs.c
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/isdn/hisax/avma1_cs.c')
-rw-r--r--drivers/isdn/hisax/avma1_cs.c60
1 files changed, 28 insertions, 32 deletions
diff --git a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c
index f7143fe1a2e7..ff6b0e185bc4 100644
--- a/drivers/isdn/hisax/avma1_cs.c
+++ b/drivers/isdn/hisax/avma1_cs.c
@@ -67,8 +67,8 @@ module_param(isdnprot, int, 0);
67 handler. 67 handler.
68*/ 68*/
69 69
70static void avma1cs_config(dev_link_t *link); 70static void avma1cs_config(struct pcmcia_device *link);
71static void avma1cs_release(dev_link_t *link); 71static void avma1cs_release(struct pcmcia_device *link);
72 72
73/* 73/*
74 The attach() and detach() entry points are used to create and destroy 74 The attach() and detach() entry points are used to create and destroy
@@ -82,10 +82,10 @@ static void avma1cs_detach(struct pcmcia_device *p_dev);
82/* 82/*
83 A linked list of "instances" of the skeleton device. Each actual 83 A linked list of "instances" of the skeleton device. Each actual
84 PCMCIA card corresponds to one device instance, and is described 84 PCMCIA card corresponds to one device instance, and is described
85 by one dev_link_t structure (defined in ds.h). 85 by one struct pcmcia_device structure (defined in ds.h).
86 86
87 You may not want to use a linked list for this -- for example, the 87 You may not want to use a linked list for this -- for example, the
88 memory card driver uses an array of dev_link_t pointers, where minor 88 memory card driver uses an array of struct pcmcia_device pointers, where minor
89 device numbers are used to derive the corresponding array index. 89 device numbers are used to derive the corresponding array index.
90*/ 90*/
91 91
@@ -95,7 +95,7 @@ static void avma1cs_detach(struct pcmcia_device *p_dev);
95 example, ethernet cards, modems). In other cases, there may be 95 example, ethernet cards, modems). In other cases, there may be
96 many actual or logical devices (SCSI adapters, memory cards with 96 many actual or logical devices (SCSI adapters, memory cards with
97 multiple partitions). The dev_node_t structures need to be kept 97 multiple partitions). The dev_node_t structures need to be kept
98 in a linked list starting at the 'dev' field of a dev_link_t 98 in a linked list starting at the 'dev' field of a struct pcmcia_device
99 structure. We allocate them in the card's private data structure, 99 structure. We allocate them in the card's private data structure,
100 because they generally can't be allocated dynamically. 100 because they generally can't be allocated dynamically.
101*/ 101*/
@@ -164,10 +164,8 @@ static int avma1cs_attach(struct pcmcia_device *p_dev)
164 164
165======================================================================*/ 165======================================================================*/
166 166
167static void avma1cs_detach(struct pcmcia_device *p_dev) 167static void avma1cs_detach(struct pcmcia_device *link)
168{ 168{
169 dev_link_t *link = dev_to_instance(p_dev);
170
171 DEBUG(0, "avma1cs_detach(0x%p)\n", link); 169 DEBUG(0, "avma1cs_detach(0x%p)\n", link);
172 170
173 if (link->state & DEV_CONFIG) 171 if (link->state & DEV_CONFIG)
@@ -184,7 +182,7 @@ static void avma1cs_detach(struct pcmcia_device *p_dev)
184 182
185======================================================================*/ 183======================================================================*/
186 184
187static int get_tuple(client_handle_t handle, tuple_t *tuple, 185static int get_tuple(struct pcmcia_device *handle, tuple_t *tuple,
188 cisparse_t *parse) 186 cisparse_t *parse)
189{ 187{
190 int i = pcmcia_get_tuple_data(handle, tuple); 188 int i = pcmcia_get_tuple_data(handle, tuple);
@@ -192,7 +190,7 @@ static int get_tuple(client_handle_t handle, tuple_t *tuple,
192 return pcmcia_parse_tuple(handle, tuple, parse); 190 return pcmcia_parse_tuple(handle, tuple, parse);
193} 191}
194 192
195static int first_tuple(client_handle_t handle, tuple_t *tuple, 193static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple,
196 cisparse_t *parse) 194 cisparse_t *parse)
197{ 195{
198 int i = pcmcia_get_first_tuple(handle, tuple); 196 int i = pcmcia_get_first_tuple(handle, tuple);
@@ -200,7 +198,7 @@ static int first_tuple(client_handle_t handle, tuple_t *tuple,
200 return get_tuple(handle, tuple, parse); 198 return get_tuple(handle, tuple, parse);
201} 199}
202 200
203static int next_tuple(client_handle_t handle, tuple_t *tuple, 201static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple,
204 cisparse_t *parse) 202 cisparse_t *parse)
205{ 203{
206 int i = pcmcia_get_next_tuple(handle, tuple); 204 int i = pcmcia_get_next_tuple(handle, tuple);
@@ -208,9 +206,8 @@ static int next_tuple(client_handle_t handle, tuple_t *tuple,
208 return get_tuple(handle, tuple, parse); 206 return get_tuple(handle, tuple, parse);
209} 207}
210 208
211static void avma1cs_config(dev_link_t *link) 209static void avma1cs_config(struct pcmcia_device *link)
212{ 210{
213 client_handle_t handle;
214 tuple_t tuple; 211 tuple_t tuple;
215 cisparse_t parse; 212 cisparse_t parse;
216 cistpl_cftable_entry_t *cf = &parse.cftable_entry; 213 cistpl_cftable_entry_t *cf = &parse.cftable_entry;
@@ -220,8 +217,7 @@ static void avma1cs_config(dev_link_t *link)
220 char devname[128]; 217 char devname[128];
221 IsdnCard_t icard; 218 IsdnCard_t icard;
222 int busy = 0; 219 int busy = 0;
223 220
224 handle = link->handle;
225 dev = link->priv; 221 dev = link->priv;
226 222
227 DEBUG(0, "avma1cs_config(0x%p)\n", link); 223 DEBUG(0, "avma1cs_config(0x%p)\n", link);
@@ -232,19 +228,19 @@ static void avma1cs_config(dev_link_t *link)
232 */ 228 */
233 do { 229 do {
234 tuple.DesiredTuple = CISTPL_CONFIG; 230 tuple.DesiredTuple = CISTPL_CONFIG;
235 i = pcmcia_get_first_tuple(handle, &tuple); 231 i = pcmcia_get_first_tuple(link, &tuple);
236 if (i != CS_SUCCESS) break; 232 if (i != CS_SUCCESS) break;
237 tuple.TupleData = buf; 233 tuple.TupleData = buf;
238 tuple.TupleDataMax = 64; 234 tuple.TupleDataMax = 64;
239 tuple.TupleOffset = 0; 235 tuple.TupleOffset = 0;
240 i = pcmcia_get_tuple_data(handle, &tuple); 236 i = pcmcia_get_tuple_data(link, &tuple);
241 if (i != CS_SUCCESS) break; 237 if (i != CS_SUCCESS) break;
242 i = pcmcia_parse_tuple(handle, &tuple, &parse); 238 i = pcmcia_parse_tuple(link, &tuple, &parse);
243 if (i != CS_SUCCESS) break; 239 if (i != CS_SUCCESS) break;
244 link->conf.ConfigBase = parse.config.base; 240 link->conf.ConfigBase = parse.config.base;
245 } while (0); 241 } while (0);
246 if (i != CS_SUCCESS) { 242 if (i != CS_SUCCESS) {
247 cs_error(link->handle, ParseTuple, i); 243 cs_error(link, ParseTuple, i);
248 link->state &= ~DEV_CONFIG_PENDING; 244 link->state &= ~DEV_CONFIG_PENDING;
249 return; 245 return;
250 } 246 }
@@ -261,7 +257,7 @@ static void avma1cs_config(dev_link_t *link)
261 tuple.DesiredTuple = CISTPL_VERS_1; 257 tuple.DesiredTuple = CISTPL_VERS_1;
262 258
263 devname[0] = 0; 259 devname[0] = 0;
264 if( !first_tuple(handle, &tuple, &parse) && parse.version_1.ns > 1 ) { 260 if( !first_tuple(link, &tuple, &parse) && parse.version_1.ns > 1 ) {
265 strlcpy(devname,parse.version_1.str + parse.version_1.ofs[1], 261 strlcpy(devname,parse.version_1.str + parse.version_1.ofs[1],
266 sizeof(devname)); 262 sizeof(devname));
267 } 263 }
@@ -272,7 +268,7 @@ static void avma1cs_config(dev_link_t *link)
272 tuple.TupleOffset = 0; tuple.TupleDataMax = 255; 268 tuple.TupleOffset = 0; tuple.TupleDataMax = 255;
273 tuple.Attributes = 0; 269 tuple.Attributes = 0;
274 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 270 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
275 i = first_tuple(handle, &tuple, &parse); 271 i = first_tuple(link, &tuple, &parse);
276 while (i == CS_SUCCESS) { 272 while (i == CS_SUCCESS) {
277 if (cf->io.nwin > 0) { 273 if (cf->io.nwin > 0) {
278 link->conf.ConfigIndex = cf->index; 274 link->conf.ConfigIndex = cf->index;
@@ -282,36 +278,36 @@ static void avma1cs_config(dev_link_t *link)
282 printk(KERN_INFO "avma1_cs: testing i/o %#x-%#x\n", 278 printk(KERN_INFO "avma1_cs: testing i/o %#x-%#x\n",
283 link->io.BasePort1, 279 link->io.BasePort1,
284 link->io.BasePort1+link->io.NumPorts1 - 1); 280 link->io.BasePort1+link->io.NumPorts1 - 1);
285 i = pcmcia_request_io(link->handle, &link->io); 281 i = pcmcia_request_io(link, &link->io);
286 if (i == CS_SUCCESS) goto found_port; 282 if (i == CS_SUCCESS) goto found_port;
287 } 283 }
288 i = next_tuple(handle, &tuple, &parse); 284 i = next_tuple(link, &tuple, &parse);
289 } 285 }
290 286
291found_port: 287found_port:
292 if (i != CS_SUCCESS) { 288 if (i != CS_SUCCESS) {
293 cs_error(link->handle, RequestIO, i); 289 cs_error(link, RequestIO, i);
294 break; 290 break;
295 } 291 }
296 292
297 /* 293 /*
298 * allocate an interrupt line 294 * allocate an interrupt line
299 */ 295 */
300 i = pcmcia_request_irq(link->handle, &link->irq); 296 i = pcmcia_request_irq(link, &link->irq);
301 if (i != CS_SUCCESS) { 297 if (i != CS_SUCCESS) {
302 cs_error(link->handle, RequestIRQ, i); 298 cs_error(link, RequestIRQ, i);
303 /* undo */ 299 /* undo */
304 pcmcia_disable_device(link->handle); 300 pcmcia_disable_device(link);
305 break; 301 break;
306 } 302 }
307 303
308 /* 304 /*
309 * configure the PCMCIA socket 305 * configure the PCMCIA socket
310 */ 306 */
311 i = pcmcia_request_configuration(link->handle, &link->conf); 307 i = pcmcia_request_configuration(link, &link->conf);
312 if (i != CS_SUCCESS) { 308 if (i != CS_SUCCESS) {
313 cs_error(link->handle, RequestConfiguration, i); 309 cs_error(link, RequestConfiguration, i);
314 pcmcia_disable_device(link->handle); 310 pcmcia_disable_device(link);
315 break; 311 break;
316 } 312 }
317 313
@@ -358,7 +354,7 @@ found_port:
358 354
359======================================================================*/ 355======================================================================*/
360 356
361static void avma1cs_release(dev_link_t *link) 357static void avma1cs_release(struct pcmcia_device *link)
362{ 358{
363 local_info_t *local = link->priv; 359 local_info_t *local = link->priv;
364 360
@@ -367,7 +363,7 @@ static void avma1cs_release(dev_link_t *link)
367 /* now unregister function with hisax */ 363 /* now unregister function with hisax */
368 HiSax_closecard(local->node.minor); 364 HiSax_closecard(local->node.minor);
369 365
370 pcmcia_disable_device(link->handle); 366 pcmcia_disable_device(link);
371} /* avma1cs_release */ 367} /* avma1cs_release */
372 368
373 369