aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/pcmcia
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-20 12:09:46 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-20 12:09:46 -0400
commit54291263519ac2c9bdda68b23b02fef3808deed4 (patch)
treed71de8172a6ab2bbe3068aece7d8911eeeb276fd /drivers/char/pcmcia
parent46ee9645094ad1eb5b4888882ecaa1fb87dcd2a3 (diff)
parentacd200bf45487271d54f05938ad9e30f32a530ee (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6: (29 commits) pcmcia: disable PCMCIA ioctl also for ARM drivers/staging/comedi: dev_node removal (quatech_daqp_cs) drivers/staging/comedi: dev_node removal (ni_mio_cs) drivers/staging/comedi: dev_node removal (ni_labpc_cs) drivers/staging/comedi: dev_node removal (ni_daq_dio24) drivers/staging/comedi: dev_node removal (ni_daq_700) drivers/staging/comedi: dev_node removal (das08_cs) drivers/staging/comedi: dev_node removal (cb_das16_cs) pata_pcmcia: get rid of extra indirection pcmcia: remove suspend-related comment from yenta_socket.c pcmcia: call pcmcia_{read,write}_cis_mem with ops_mutex held pcmcia: remove pcmcia_add_device_lock pcmcia: update gfp/slab.h includes pcmcia: remove unused mem_op.h pcmcia: do not autoadd root PCI bus resources pcmcia: clarify alloc_io_space, move it to resource handlers pcmcia: move all pcmcia_resource_ops providers into one module pcmcia: move high level CIS access code to separate file pcmcia: dev_node removal (core) pcmcia: dev_node removal (remaining drivers) ...
Diffstat (limited to 'drivers/char/pcmcia')
-rw-r--r--drivers/char/pcmcia/cm4000_cs.c9
-rw-r--r--drivers/char/pcmcia/cm4040_cs.c5
-rw-r--r--drivers/char/pcmcia/ipwireless/main.c19
-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/char/pcmcia/synclink_cs.c22
7 files changed, 15 insertions, 63 deletions
diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c
index 90b199f97bec..e7956acf2ad6 100644
--- a/drivers/char/pcmcia/cm4000_cs.c
+++ b/drivers/char/pcmcia/cm4000_cs.c
@@ -106,7 +106,6 @@ static int major; /* major number we get from the kernel */
106 106
107struct cm4000_dev { 107struct cm4000_dev {
108 struct pcmcia_device *p_dev; 108 struct pcmcia_device *p_dev;
109 dev_node_t node; /* OS node (major,minor) */
110 109
111 unsigned char atr[MAX_ATR]; 110 unsigned char atr[MAX_ATR];
112 unsigned char rbuf[512]; 111 unsigned char rbuf[512];
@@ -884,8 +883,7 @@ static void monitor_card(unsigned long p)
884 /* slow down warning, but prompt immediately after insertion */ 883 /* slow down warning, but prompt immediately after insertion */
885 if (dev->cwarn == 0 || dev->cwarn == 10) { 884 if (dev->cwarn == 0 || dev->cwarn == 10) {
886 set_bit(IS_BAD_CARD, &dev->flags); 885 set_bit(IS_BAD_CARD, &dev->flags);
887 printk(KERN_WARNING MODULE_NAME ": device %s: ", 886 dev_warn(&dev->p_dev->dev, MODULE_NAME ": ");
888 dev->node.dev_name);
889 if (test_bit(IS_BAD_CSUM, &dev->flags)) { 887 if (test_bit(IS_BAD_CSUM, &dev->flags)) {
890 DEBUGP(4, dev, "ATR checksum (0x%.2x, should " 888 DEBUGP(4, dev, "ATR checksum (0x%.2x, should "
891 "be zero) failed\n", dev->atr_csum); 889 "be zero) failed\n", dev->atr_csum);
@@ -1781,11 +1779,6 @@ static int cm4000_config(struct pcmcia_device * link, int devno)
1781 goto cs_release; 1779 goto cs_release;
1782 1780
1783 dev = link->priv; 1781 dev = link->priv;
1784 sprintf(dev->node.dev_name, DEVICE_NAME "%d", devno);
1785 dev->node.major = major;
1786 dev->node.minor = devno;
1787 dev->node.next = NULL;
1788 link->dev_node = &dev->node;
1789 1782
1790 return 0; 1783 return 0;
1791 1784
diff --git a/drivers/char/pcmcia/cm4040_cs.c b/drivers/char/pcmcia/cm4040_cs.c
index a6a70e476bea..c0775c844e08 100644
--- a/drivers/char/pcmcia/cm4040_cs.c
+++ b/drivers/char/pcmcia/cm4040_cs.c
@@ -72,7 +72,6 @@ static struct class *cmx_class;
72 72
73struct reader_dev { 73struct reader_dev {
74 struct pcmcia_device *p_dev; 74 struct pcmcia_device *p_dev;
75 dev_node_t node;
76 wait_queue_head_t devq; 75 wait_queue_head_t devq;
77 wait_queue_head_t poll_wait; 76 wait_queue_head_t poll_wait;
78 wait_queue_head_t read_wait; 77 wait_queue_head_t read_wait;
@@ -568,10 +567,6 @@ static int reader_config(struct pcmcia_device *link, int devno)
568 } 567 }
569 568
570 dev = link->priv; 569 dev = link->priv;
571 sprintf(dev->node.dev_name, DEVICE_NAME "%d", devno);
572 dev->node.major = major;
573 dev->node.minor = devno;
574 dev->node.next = &dev->node;
575 570
576 DEBUGP(2, dev, "device " DEVICE_NAME "%d at 0x%.4x-0x%.4x\n", devno, 571 DEBUGP(2, dev, "device " DEVICE_NAME "%d at 0x%.4x-0x%.4x\n", devno,
577 link->io.BasePort1, link->io.BasePort1+link->io.NumPorts1); 572 link->io.BasePort1, link->io.BasePort1+link->io.NumPorts1);
diff --git a/drivers/char/pcmcia/ipwireless/main.c b/drivers/char/pcmcia/ipwireless/main.c
index dff24dae1485..63c32e3f23ba 100644
--- a/drivers/char/pcmcia/ipwireless/main.c
+++ b/drivers/char/pcmcia/ipwireless/main.c
@@ -195,9 +195,6 @@ static int config_ipwireless(struct ipw_dev *ipw)
195 link->conf.Attributes = CONF_ENABLE_IRQ; 195 link->conf.Attributes = CONF_ENABLE_IRQ;
196 link->conf.IntType = INT_MEMORY_AND_IO; 196 link->conf.IntType = INT_MEMORY_AND_IO;
197 197
198 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
199 link->irq.Handler = ipwireless_interrupt;
200
201 INIT_WORK(&ipw->work_reboot, signalled_reboot_work); 198 INIT_WORK(&ipw->work_reboot, signalled_reboot_work);
202 199
203 ipwireless_init_hardware_v1(ipw->hardware, link->io.BasePort1, 200 ipwireless_init_hardware_v1(ipw->hardware, link->io.BasePort1,
@@ -205,8 +202,7 @@ static int config_ipwireless(struct ipw_dev *ipw)
205 ipw->is_v2_card, signalled_reboot_callback, 202 ipw->is_v2_card, signalled_reboot_callback,
206 ipw); 203 ipw);
207 204
208 ret = pcmcia_request_irq(link, &link->irq); 205 ret = pcmcia_request_irq(link, ipwireless_interrupt);
209
210 if (ret != 0) 206 if (ret != 0)
211 goto exit; 207 goto exit;
212 208
@@ -217,7 +213,7 @@ static int config_ipwireless(struct ipw_dev *ipw)
217 (unsigned int) link->io.BasePort1, 213 (unsigned int) link->io.BasePort1,
218 (unsigned int) (link->io.BasePort1 + 214 (unsigned int) (link->io.BasePort1 +
219 link->io.NumPorts1 - 1), 215 link->io.NumPorts1 - 1),
220 (unsigned int) link->irq.AssignedIRQ); 216 (unsigned int) link->irq);
221 if (ipw->attr_memory && ipw->common_memory) 217 if (ipw->attr_memory && ipw->common_memory)
222 printk(KERN_INFO IPWIRELESS_PCCARD_NAME 218 printk(KERN_INFO IPWIRELESS_PCCARD_NAME
223 ": attr memory 0x%08lx-0x%08lx, common memory 0x%08lx-0x%08lx\n", 219 ": attr memory 0x%08lx-0x%08lx, common memory 0x%08lx-0x%08lx\n",
@@ -232,8 +228,7 @@ static int config_ipwireless(struct ipw_dev *ipw)
232 if (!ipw->network) 228 if (!ipw->network)
233 goto exit; 229 goto exit;
234 230
235 ipw->tty = ipwireless_tty_create(ipw->hardware, ipw->network, 231 ipw->tty = ipwireless_tty_create(ipw->hardware, ipw->network);
236 ipw->nodes);
237 if (!ipw->tty) 232 if (!ipw->tty)
238 goto exit; 233 goto exit;
239 234
@@ -248,8 +243,6 @@ static int config_ipwireless(struct ipw_dev *ipw)
248 if (ret != 0) 243 if (ret != 0)
249 goto exit; 244 goto exit;
250 245
251 link->dev_node = &ipw->nodes[0];
252
253 return 0; 246 return 0;
254 247
255exit: 248exit:
@@ -271,8 +264,6 @@ exit:
271 264
272static void release_ipwireless(struct ipw_dev *ipw) 265static void release_ipwireless(struct ipw_dev *ipw)
273{ 266{
274 pcmcia_disable_device(ipw->link);
275
276 if (ipw->common_memory) { 267 if (ipw->common_memory) {
277 release_mem_region(ipw->request_common_memory.Base, 268 release_mem_region(ipw->request_common_memory.Base,
278 ipw->request_common_memory.Size); 269 ipw->request_common_memory.Size);
@@ -288,7 +279,6 @@ static void release_ipwireless(struct ipw_dev *ipw)
288 if (ipw->attr_memory) 279 if (ipw->attr_memory)
289 pcmcia_release_window(ipw->link, ipw->handle_attr_memory); 280 pcmcia_release_window(ipw->link, ipw->handle_attr_memory);
290 281
291 /* Break the link with Card Services */
292 pcmcia_disable_device(ipw->link); 282 pcmcia_disable_device(ipw->link);
293} 283}
294 284
@@ -313,9 +303,6 @@ static int ipwireless_attach(struct pcmcia_device *link)
313 ipw->link = link; 303 ipw->link = link;
314 link->priv = ipw; 304 link->priv = ipw;
315 305
316 /* Link this device into our device list. */
317 link->dev_node = &ipw->nodes[0];
318
319 ipw->hardware = ipwireless_hardware_create(); 306 ipw->hardware = ipwireless_hardware_create();
320 if (!ipw->hardware) { 307 if (!ipw->hardware) {
321 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/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index c31a0d913d37..308903ec8bf8 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -220,7 +220,6 @@ typedef struct _mgslpc_info {
220 220
221 /* PCMCIA support */ 221 /* PCMCIA support */
222 struct pcmcia_device *p_dev; 222 struct pcmcia_device *p_dev;
223 dev_node_t node;
224 int stop; 223 int stop;
225 224
226 /* SPPP/Cisco HDLC device parts */ 225 /* SPPP/Cisco HDLC device parts */
@@ -552,10 +551,6 @@ static int mgslpc_probe(struct pcmcia_device *link)
552 551
553 /* Initialize the struct pcmcia_device structure */ 552 /* Initialize the struct pcmcia_device structure */
554 553
555 /* Interrupt setup */
556 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
557 link->irq.Handler = NULL;
558
559 link->conf.Attributes = 0; 554 link->conf.Attributes = 0;
560 link->conf.IntType = INT_MEMORY_AND_IO; 555 link->conf.IntType = INT_MEMORY_AND_IO;
561 556
@@ -608,9 +603,7 @@ static int mgslpc_config(struct pcmcia_device *link)
608 link->conf.ConfigIndex = 8; 603 link->conf.ConfigIndex = 8;
609 link->conf.Present = PRESENT_OPTION; 604 link->conf.Present = PRESENT_OPTION;
610 605
611 link->irq.Handler = mgslpc_isr; 606 ret = pcmcia_request_irq(link, mgslpc_isr);
612
613 ret = pcmcia_request_irq(link, &link->irq);
614 if (ret) 607 if (ret)
615 goto failed; 608 goto failed;
616 ret = pcmcia_request_configuration(link, &link->conf); 609 ret = pcmcia_request_configuration(link, &link->conf);
@@ -618,17 +611,12 @@ static int mgslpc_config(struct pcmcia_device *link)
618 goto failed; 611 goto failed;
619 612
620 info->io_base = link->io.BasePort1; 613 info->io_base = link->io.BasePort1;
621 info->irq_level = link->irq.AssignedIRQ; 614 info->irq_level = link->irq;
622
623 /* add to linked list of devices */
624 sprintf(info->node.dev_name, "mgslpc0");
625 info->node.major = info->node.minor = 0;
626 link->dev_node = &info->node;
627 615
628 printk(KERN_INFO "%s: index 0x%02x:", 616 dev_info(&link->dev, "index 0x%02x:",
629 info->node.dev_name, link->conf.ConfigIndex); 617 link->conf.ConfigIndex);
630 if (link->conf.Attributes & CONF_ENABLE_IRQ) 618 if (link->conf.Attributes & CONF_ENABLE_IRQ)
631 printk(", irq %d", link->irq.AssignedIRQ); 619 printk(", irq %d", link->irq);
632 if (link->io.NumPorts1) 620 if (link->io.NumPorts1)
633 printk(", io 0x%04x-0x%04x", link->io.BasePort1, 621 printk(", io 0x%04x-0x%04x", link->io.BasePort1,
634 link->io.BasePort1+link->io.NumPorts1-1); 622 link->io.BasePort1+link->io.NumPorts1-1);