aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/pcmcia
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2010-03-20 14:43:26 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2010-05-10 04:23:16 -0400
commitb498ada6d0cf0f9828b0c590f9fa2e84f60f5709 (patch)
treed066ef21b59ff0c7143a9aad2e7bf6f849a496dc /drivers/char/pcmcia
parentc7c2fa079073ab92b0736a161b4cf1051a3e631f (diff)
pcmcia: dev_node removal (remaining drivers)
As a fourth step, remove any remaining usages of dev_node_t from drivers: - ipwireless can be simplified a bit, as we do not need to pass around the (write-only) dev_node_t around. - avma1_cs can be simplified as well, if we only keep the minor number around as "priv" data, not a full-fledged struct. Acked-by: Jiri Kosina <jkosina@suse.cz> Acked-by: Karsten Keil <isdn@linux-pingi.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/char/pcmcia')
-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
4 files changed, 7 insertions, 24 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);