aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/serial_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2010-03-07 06:21:16 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2010-05-10 04:23:13 -0400
commiteb14120f743d29744d9475bffec56ff4ad43a749 (patch)
tree56857094d2b0cfc0ecbd1685f18d6edbe78e140f /drivers/serial/serial_cs.c
parenta7debe789dfcaee9c4d81e5738b0be8c5d93930b (diff)
pcmcia: re-work pcmcia_request_irq()
Instead of the old pcmcia_request_irq() interface, drivers may now choose between: - calling request_irq/free_irq directly. Use the IRQ from *p_dev->irq. - use pcmcia_request_irq(p_dev, handler_t); the PCMCIA core will clean up automatically on calls to pcmcia_disable_device() or device ejection. - drivers still not capable of IRQF_SHARED (or not telling us so) may use the deprecated pcmcia_request_exclusive_irq() for the time being; they might receive a shared IRQ nonetheless. CC: linux-bluetooth@vger.kernel.org CC: netdev@vger.kernel.org CC: linux-wireless@vger.kernel.org CC: linux-serial@vger.kernel.org CC: alsa-devel@alsa-project.org CC: linux-usb@vger.kernel.org CC: linux-ide@vger.kernel.org Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/serial/serial_cs.c')
-rw-r--r--drivers/serial/serial_cs.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c
index 8cfa5b12ea7a..6459252ed371 100644
--- a/drivers/serial/serial_cs.c
+++ b/drivers/serial/serial_cs.c
@@ -343,7 +343,6 @@ static int serial_probe(struct pcmcia_device *link)
343 343
344 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 344 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
345 link->io.NumPorts1 = 8; 345 link->io.NumPorts1 = 8;
346 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
347 link->conf.Attributes = CONF_ENABLE_IRQ; 346 link->conf.Attributes = CONF_ENABLE_IRQ;
348 if (do_sound) { 347 if (do_sound) {
349 link->conf.Attributes |= CONF_ENABLE_SPKR; 348 link->conf.Attributes |= CONF_ENABLE_SPKR;
@@ -486,7 +485,7 @@ static int simple_config(struct pcmcia_device *link)
486 } 485 }
487 if (info->slave) { 486 if (info->slave) {
488 return setup_serial(link, info, port, 487 return setup_serial(link, info, port,
489 link->irq.AssignedIRQ); 488 link->irq);
490 } 489 }
491 } 490 }
492 491
@@ -507,10 +506,6 @@ static int simple_config(struct pcmcia_device *link)
507 return -1; 506 return -1;
508 507
509found_port: 508found_port:
510 i = pcmcia_request_irq(link, &link->irq);
511 if (i != 0)
512 link->irq.AssignedIRQ = 0;
513
514 if (info->multi && (info->manfid == MANFID_3COM)) 509 if (info->multi && (info->manfid == MANFID_3COM))
515 link->conf.ConfigIndex &= ~(0x08); 510 link->conf.ConfigIndex &= ~(0x08);
516 511
@@ -523,7 +518,7 @@ found_port:
523 i = pcmcia_request_configuration(link, &link->conf); 518 i = pcmcia_request_configuration(link, &link->conf);
524 if (i != 0) 519 if (i != 0)
525 return -1; 520 return -1;
526 return setup_serial(link, info, link->io.BasePort1, link->irq.AssignedIRQ); 521 return setup_serial(link, info, link->io.BasePort1, link->irq);
527} 522}
528 523
529static int multi_config_check(struct pcmcia_device *p_dev, 524static int multi_config_check(struct pcmcia_device *p_dev,
@@ -586,13 +581,9 @@ static int multi_config(struct pcmcia_device *link)
586 } 581 }
587 } 582 }
588 583
589 i = pcmcia_request_irq(link, &link->irq); 584 if (!link->irq)
590 if (i != 0) { 585 dev_warn(&link->dev,
591 /* FIXME: comment does not fit, error handling does not fit */ 586 "serial_cs: no usable IRQ found, continuing...\n");
592 printk(KERN_NOTICE
593 "serial_cs: no usable port range found, giving up\n");
594 link->irq.AssignedIRQ = 0;
595 }
596 587
597 /* 588 /*
598 * Apply any configuration quirks. 589 * Apply any configuration quirks.
@@ -615,11 +606,11 @@ static int multi_config(struct pcmcia_device *link)
615 if (link->conf.ConfigIndex == 1 || 606 if (link->conf.ConfigIndex == 1 ||
616 link->conf.ConfigIndex == 3) { 607 link->conf.ConfigIndex == 3) {
617 err = setup_serial(link, info, base2, 608 err = setup_serial(link, info, base2,
618 link->irq.AssignedIRQ); 609 link->irq);
619 base2 = link->io.BasePort1; 610 base2 = link->io.BasePort1;
620 } else { 611 } else {
621 err = setup_serial(link, info, link->io.BasePort1, 612 err = setup_serial(link, info, link->io.BasePort1,
622 link->irq.AssignedIRQ); 613 link->irq);
623 } 614 }
624 info->c950ctrl = base2; 615 info->c950ctrl = base2;
625 616
@@ -633,10 +624,10 @@ static int multi_config(struct pcmcia_device *link)
633 return 0; 624 return 0;
634 } 625 }
635 626
636 setup_serial(link, info, link->io.BasePort1, link->irq.AssignedIRQ); 627 setup_serial(link, info, link->io.BasePort1, link->irq);
637 for (i = 0; i < info->multi - 1; i++) 628 for (i = 0; i < info->multi - 1; i++)
638 setup_serial(link, info, base2 + (8 * i), 629 setup_serial(link, info, base2 + (8 * i),
639 link->irq.AssignedIRQ); 630 link->irq);
640 return 0; 631 return 0;
641} 632}
642 633