aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/pcmcia/ipwireless/main.c8
-rw-r--r--drivers/char/pcmcia/ipwireless/main.h1
-rw-r--r--drivers/char/pcmcia/ipwireless/tty.c19
-rw-r--r--drivers/char/pcmcia/ipwireless/tty.h3
-rw-r--r--drivers/isdn/hisax/avma1_cs.c51
5 files changed, 10 insertions, 72 deletions
diff --git a/drivers/char/pcmcia/ipwireless/main.c b/drivers/char/pcmcia/ipwireless/main.c
index 2237890bc256..63c32e3f23ba 100644
--- a/drivers/char/pcmcia/ipwireless/main.c
+++ b/drivers/char/pcmcia/ipwireless/main.c
@@ -228,8 +228,7 @@ static int config_ipwireless(struct ipw_dev *ipw)
228 if (!ipw->network) 228 if (!ipw->network)
229 goto exit; 229 goto exit;
230 230
231 ipw->tty = ipwireless_tty_create(ipw->hardware, ipw->network, 231 ipw->tty = ipwireless_tty_create(ipw->hardware, ipw->network);
232 ipw->nodes);
233 if (!ipw->tty) 232 if (!ipw->tty)
234 goto exit; 233 goto exit;
235 234
@@ -244,8 +243,6 @@ static int config_ipwireless(struct ipw_dev *ipw)
244 if (ret != 0) 243 if (ret != 0)
245 goto exit; 244 goto exit;
246 245
247 link->dev_node = &ipw->nodes[0];
248
249 return 0; 246 return 0;
250 247
251exit: 248exit:
@@ -306,9 +303,6 @@ static int ipwireless_attach(struct pcmcia_device *link)
306 ipw->link = link; 303 ipw->link = link;
307 link->priv = ipw; 304 link->priv = ipw;
308 305
309 /* Link this device into our device list. */
310 link->dev_node = &ipw->nodes[0];
311
312 ipw->hardware = ipwireless_hardware_create(); 306 ipw->hardware = ipwireless_hardware_create();
313 if (!ipw->hardware) { 307 if (!ipw->hardware) {
314 kfree(ipw); 308 kfree(ipw);
diff --git a/drivers/char/pcmcia/ipwireless/main.h b/drivers/char/pcmcia/ipwireless/main.h
index 0e0363af9ab2..96d0ef31b172 100644
--- a/drivers/char/pcmcia/ipwireless/main.h
+++ b/drivers/char/pcmcia/ipwireless/main.h
@@ -54,7 +54,6 @@ struct ipw_dev {
54 void __iomem *common_memory; 54 void __iomem *common_memory;
55 win_req_t request_common_memory; 55 win_req_t request_common_memory;
56 56
57 dev_node_t nodes[2];
58 /* Reference to attribute memory, containing CIS data */ 57 /* Reference to attribute memory, containing CIS data */
59 void *attribute_memory; 58 void *attribute_memory;
60 59
diff --git a/drivers/char/pcmcia/ipwireless/tty.c b/drivers/char/pcmcia/ipwireless/tty.c
index 2bb7874a6899..1a2c2c3b068f 100644
--- a/drivers/char/pcmcia/ipwireless/tty.c
+++ b/drivers/char/pcmcia/ipwireless/tty.c
@@ -487,7 +487,7 @@ static int ipw_ioctl(struct tty_struct *linux_tty, struct file *file,
487 return tty_mode_ioctl(linux_tty, file, cmd , arg); 487 return tty_mode_ioctl(linux_tty, file, cmd , arg);
488} 488}
489 489
490static int add_tty(dev_node_t *nodesp, int j, 490static int add_tty(int j,
491 struct ipw_hardware *hardware, 491 struct ipw_hardware *hardware,
492 struct ipw_network *network, int channel_idx, 492 struct ipw_network *network, int channel_idx,
493 int secondary_channel_idx, int tty_type) 493 int secondary_channel_idx, int tty_type)
@@ -510,19 +510,13 @@ static int add_tty(dev_node_t *nodesp, int j,
510 ipwireless_associate_network_tty(network, 510 ipwireless_associate_network_tty(network,
511 secondary_channel_idx, 511 secondary_channel_idx,
512 ttys[j]); 512 ttys[j]);
513 if (nodesp != NULL) {
514 sprintf(nodesp->dev_name, "ttyIPWp%d", j);
515 nodesp->major = ipw_tty_driver->major;
516 nodesp->minor = j + ipw_tty_driver->minor_start;
517 }
518 if (get_tty(j + ipw_tty_driver->minor_start) == ttys[j]) 513 if (get_tty(j + ipw_tty_driver->minor_start) == ttys[j])
519 report_registering(ttys[j]); 514 report_registering(ttys[j]);
520 return 0; 515 return 0;
521} 516}
522 517
523struct ipw_tty *ipwireless_tty_create(struct ipw_hardware *hardware, 518struct ipw_tty *ipwireless_tty_create(struct ipw_hardware *hardware,
524 struct ipw_network *network, 519 struct ipw_network *network)
525 dev_node_t *nodes)
526{ 520{
527 int i, j; 521 int i, j;
528 522
@@ -539,26 +533,23 @@ struct ipw_tty *ipwireless_tty_create(struct ipw_hardware *hardware,
539 if (allfree) { 533 if (allfree) {
540 j = i; 534 j = i;
541 535
542 if (add_tty(&nodes[0], j, hardware, network, 536 if (add_tty(j, hardware, network,
543 IPW_CHANNEL_DIALLER, IPW_CHANNEL_RAS, 537 IPW_CHANNEL_DIALLER, IPW_CHANNEL_RAS,
544 TTYTYPE_MODEM)) 538 TTYTYPE_MODEM))
545 return NULL; 539 return NULL;
546 540
547 j += IPWIRELESS_PCMCIA_MINOR_RANGE; 541 j += IPWIRELESS_PCMCIA_MINOR_RANGE;
548 if (add_tty(&nodes[1], j, hardware, network, 542 if (add_tty(j, hardware, network,
549 IPW_CHANNEL_DIALLER, -1, 543 IPW_CHANNEL_DIALLER, -1,
550 TTYTYPE_MONITOR)) 544 TTYTYPE_MONITOR))
551 return NULL; 545 return NULL;
552 546
553 j += IPWIRELESS_PCMCIA_MINOR_RANGE; 547 j += IPWIRELESS_PCMCIA_MINOR_RANGE;
554 if (add_tty(NULL, j, hardware, network, 548 if (add_tty(j, hardware, network,
555 IPW_CHANNEL_RAS, -1, 549 IPW_CHANNEL_RAS, -1,
556 TTYTYPE_RAS_RAW)) 550 TTYTYPE_RAS_RAW))
557 return NULL; 551 return NULL;
558 552
559 nodes[0].next = &nodes[1];
560 nodes[1].next = NULL;
561
562 return ttys[i]; 553 return ttys[i];
563 } 554 }
564 } 555 }
diff --git a/drivers/char/pcmcia/ipwireless/tty.h b/drivers/char/pcmcia/ipwireless/tty.h
index b0deb9168b6b..4da6c201f727 100644
--- a/drivers/char/pcmcia/ipwireless/tty.h
+++ b/drivers/char/pcmcia/ipwireless/tty.h
@@ -34,8 +34,7 @@ int ipwireless_tty_init(void);
34void ipwireless_tty_release(void); 34void ipwireless_tty_release(void);
35 35
36struct ipw_tty *ipwireless_tty_create(struct ipw_hardware *hw, 36struct ipw_tty *ipwireless_tty_create(struct ipw_hardware *hw,
37 struct ipw_network *net, 37 struct ipw_network *net);
38 dev_node_t *nodes);
39void ipwireless_tty_free(struct ipw_tty *tty); 38void ipwireless_tty_free(struct ipw_tty *tty);
40void ipwireless_tty_received(struct ipw_tty *tty, unsigned char *data, 39void ipwireless_tty_received(struct ipw_tty *tty, unsigned char *data,
41 unsigned int length); 40 unsigned int length);
diff --git a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c
index 3ae2176c6f75..a80a7617f16f 100644
--- a/drivers/isdn/hisax/avma1_cs.c
+++ b/drivers/isdn/hisax/avma1_cs.c
@@ -62,31 +62,6 @@ static void avma1cs_release(struct pcmcia_device *link);
62static void avma1cs_detach(struct pcmcia_device *p_dev) __devexit ; 62static void avma1cs_detach(struct pcmcia_device *p_dev) __devexit ;
63 63
64 64
65/*
66 A linked list of "instances" of the skeleton device. Each actual
67 PCMCIA card corresponds to one device instance, and is described
68 by one struct pcmcia_device structure (defined in ds.h).
69
70 You may not want to use a linked list for this -- for example, the
71 memory card driver uses an array of struct pcmcia_device pointers, where minor
72 device numbers are used to derive the corresponding array index.
73*/
74
75/*
76 A driver needs to provide a dev_node_t structure for each device
77 on a card. In some cases, there is only one device per card (for
78 example, ethernet cards, modems). In other cases, there may be
79 many actual or logical devices (SCSI adapters, memory cards with
80 multiple partitions). The dev_node_t structures need to be kept
81 in a linked list starting at the 'dev' field of a struct pcmcia_device
82 structure. We allocate them in the card's private data structure,
83 because they generally can't be allocated dynamically.
84*/
85
86typedef struct local_info_t {
87 dev_node_t node;
88} local_info_t;
89
90/*====================================================================== 65/*======================================================================
91 66
92 avma1cs_attach() creates an "instance" of the driver, allocating 67 avma1cs_attach() creates an "instance" of the driver, allocating
@@ -101,17 +76,8 @@ typedef struct local_info_t {
101 76
102static int __devinit avma1cs_probe(struct pcmcia_device *p_dev) 77static int __devinit avma1cs_probe(struct pcmcia_device *p_dev)
103{ 78{
104 local_info_t *local;
105
106 dev_dbg(&p_dev->dev, "avma1cs_attach()\n"); 79 dev_dbg(&p_dev->dev, "avma1cs_attach()\n");
107 80
108 /* Allocate space for private device-specific data */
109 local = kzalloc(sizeof(local_info_t), GFP_KERNEL);
110 if (!local)
111 return -ENOMEM;
112
113 p_dev->priv = local;
114
115 /* The io structure describes IO port mapping */ 81 /* The io structure describes IO port mapping */
116 p_dev->io.NumPorts1 = 16; 82 p_dev->io.NumPorts1 = 16;
117 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 83 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
@@ -173,14 +139,11 @@ static int avma1cs_configcheck(struct pcmcia_device *p_dev,
173 139
174static int __devinit avma1cs_config(struct pcmcia_device *link) 140static int __devinit avma1cs_config(struct pcmcia_device *link)
175{ 141{
176 local_info_t *dev;
177 int i = -1; 142 int i = -1;
178 char devname[128]; 143 char devname[128];
179 IsdnCard_t icard; 144 IsdnCard_t icard;
180 int busy = 0; 145 int busy = 0;
181 146
182 dev = link->priv;
183
184 dev_dbg(&link->dev, "avma1cs_config(0x%p)\n", link); 147 dev_dbg(&link->dev, "avma1cs_config(0x%p)\n", link);
185 148
186 devname[0] = 0; 149 devname[0] = 0;
@@ -211,14 +174,6 @@ static int __devinit avma1cs_config(struct pcmcia_device *link)
211 174
212 } while (0); 175 } while (0);
213 176
214 /* At this point, the dev_node_t structure(s) should be
215 initialized and arranged in a linked list at link->dev. */
216
217 strcpy(dev->node.dev_name, "A1");
218 dev->node.major = 45;
219 dev->node.minor = 0;
220 link->dev_node = &dev->node;
221
222 /* If any step failed, release any partially configured state */ 177 /* If any step failed, release any partially configured state */
223 if (i != 0) { 178 if (i != 0) {
224 avma1cs_release(link); 179 avma1cs_release(link);
@@ -239,7 +194,7 @@ static int __devinit avma1cs_config(struct pcmcia_device *link)
239 avma1cs_release(link); 194 avma1cs_release(link);
240 return -ENODEV; 195 return -ENODEV;
241 } 196 }
242 dev->node.minor = i; 197 link->priv = (void *) (unsigned long) i;
243 198
244 return 0; 199 return 0;
245} /* avma1cs_config */ 200} /* avma1cs_config */
@@ -254,12 +209,12 @@ static int __devinit avma1cs_config(struct pcmcia_device *link)
254 209
255static void avma1cs_release(struct pcmcia_device *link) 210static void avma1cs_release(struct pcmcia_device *link)
256{ 211{
257 local_info_t *local = link->priv; 212 unsigned long minor = (unsigned long) link->priv;
258 213
259 dev_dbg(&link->dev, "avma1cs_release(0x%p)\n", link); 214 dev_dbg(&link->dev, "avma1cs_release(0x%p)\n", link);
260 215
261 /* now unregister function with hisax */ 216 /* now unregister function with hisax */
262 HiSax_closecard(local->node.minor); 217 HiSax_closecard(minor);
263 218
264 pcmcia_disable_device(link); 219 pcmcia_disable_device(link);
265} /* avma1cs_release */ 220} /* avma1cs_release */