aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/pcmcia_resource.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2010-03-07 04:51:23 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2010-05-10 04:23:12 -0400
commit6f840afb416748c15cf55c19b45c4870554c3af1 (patch)
tree3d162fe121b35e2c7392c201226c9599f068517b /drivers/pcmcia/pcmcia_resource.c
parent6f0f38c45a8f2f511c25893e33011ff32fc811db (diff)
pcmcia: replace struct irq with uint pcmcia_irq in struct pcmcia_socket
As we don't need the "Config" counter any more, we can simplify struct pcmcia_socket. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia/pcmcia_resource.c')
-rw-r--r--drivers/pcmcia/pcmcia_resource.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index ff9c0bcb7e3a..cefc4cda9d3e 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -430,13 +430,10 @@ static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req)
430 dev_dbg(&s->dev, "IRQ attributes must match assigned ones\n"); 430 dev_dbg(&s->dev, "IRQ attributes must match assigned ones\n");
431 goto out; 431 goto out;
432 } 432 }
433 if (s->irq.AssignedIRQ != req->AssignedIRQ) { 433 if (s->pcmcia_irq != req->AssignedIRQ) {
434 dev_dbg(&s->dev, "IRQ must match assigned one\n"); 434 dev_dbg(&s->dev, "IRQ must match assigned one\n");
435 goto out; 435 goto out;
436 } 436 }
437 if (--s->irq.Config == 0) {
438 c->state &= ~CONFIG_IRQ_REQ;
439 }
440 437
441 if (req->Handler) 438 if (req->Handler)
442 free_irq(req->AssignedIRQ, p_dev->priv); 439 free_irq(req->AssignedIRQ, p_dev->priv);
@@ -533,7 +530,7 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev,
533 if (req->Attributes & CONF_ENABLE_SPKR) 530 if (req->Attributes & CONF_ENABLE_SPKR)
534 s->socket.flags |= SS_SPKR_ENA; 531 s->socket.flags |= SS_SPKR_ENA;
535 if (req->Attributes & CONF_ENABLE_IRQ) 532 if (req->Attributes & CONF_ENABLE_IRQ)
536 s->socket.io_irq = s->irq.AssignedIRQ; 533 s->socket.io_irq = s->pcmcia_irq;
537 else 534 else
538 s->socket.io_irq = 0; 535 s->socket.io_irq = 0;
539 s->ops->set_socket(s, &s->socket); 536 s->ops->set_socket(s, &s->socket);
@@ -556,7 +553,7 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev,
556 if (req->Present & PRESENT_IOBASE_0) 553 if (req->Present & PRESENT_IOBASE_0)
557 c->Option |= COR_ADDR_DECODE; 554 c->Option |= COR_ADDR_DECODE;
558 } 555 }
559 if (c->state & CONFIG_IRQ_REQ) 556 if (req->Attributes & CONF_ENABLE_IRQ)
560 if (!(c->irq.Attributes & IRQ_FORCED_PULSE)) 557 if (!(c->irq.Attributes & IRQ_FORCED_PULSE))
561 c->Option |= COR_LEVEL_REQ; 558 c->Option |= COR_LEVEL_REQ;
562 pcmcia_write_cis_mem(s, 1, (base + CISREG_COR)>>1, 1, &c->Option); 559 pcmcia_write_cis_mem(s, 1, (base + CISREG_COR)>>1, 1, &c->Option);
@@ -711,10 +708,6 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
711 dev_dbg(&s->dev, "Configuration is locked\n"); 708 dev_dbg(&s->dev, "Configuration is locked\n");
712 goto out; 709 goto out;
713 } 710 }
714 if (c->state & CONFIG_IRQ_REQ) {
715 dev_dbg(&s->dev, "IRQ already configured\n");
716 goto out;
717 }
718 711
719 if (!irq) { 712 if (!irq) {
720 dev_dbg(&s->dev, "no IRQ available\n"); 713 dev_dbg(&s->dev, "no IRQ available\n");
@@ -723,8 +716,6 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
723 716
724 if (!(req->Attributes & IRQ_TYPE_DYNAMIC_SHARING)) { 717 if (!(req->Attributes & IRQ_TYPE_DYNAMIC_SHARING)) {
725 req->Attributes |= IRQ_TYPE_DYNAMIC_SHARING; 718 req->Attributes |= IRQ_TYPE_DYNAMIC_SHARING;
726 dev_printk(KERN_WARNING, &p_dev->dev, "pcmcia: "
727 "request for exclusive IRQ could not be fulfilled.\n");
728 dev_printk(KERN_WARNING, &p_dev->dev, "pcmcia: the driver " 719 dev_printk(KERN_WARNING, &p_dev->dev, "pcmcia: the driver "
729 "needs updating to supported shared IRQ lines.\n"); 720 "needs updating to supported shared IRQ lines.\n");
730 } 721 }
@@ -741,9 +732,7 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
741 732
742 c->irq.Attributes = req->Attributes; 733 c->irq.Attributes = req->Attributes;
743 req->AssignedIRQ = irq; 734 req->AssignedIRQ = irq;
744 s->irq.Config++;
745 735
746 c->state |= CONFIG_IRQ_REQ;
747 p_dev->_irq = 1; 736 p_dev->_irq = 1;
748 737
749 ret = 0; 738 ret = 0;
@@ -795,7 +784,7 @@ static int pcmcia_setup_isa_irq(struct pcmcia_device *p_dev, int type)
795 p_dev); 784 p_dev);
796 if (!ret) { 785 if (!ret) {
797 free_irq(irq, p_dev); 786 free_irq(irq, p_dev);
798 p_dev->irq_v = s->irq.AssignedIRQ = irq; 787 p_dev->irq_v = s->pcmcia_irq = irq;
799 pcmcia_used_irq[irq]++; 788 pcmcia_used_irq[irq]++;
800 break; 789 break;
801 } 790 }
@@ -806,8 +795,8 @@ static int pcmcia_setup_isa_irq(struct pcmcia_device *p_dev, int type)
806 795
807void pcmcia_cleanup_irq(struct pcmcia_socket *s) 796void pcmcia_cleanup_irq(struct pcmcia_socket *s)
808{ 797{
809 pcmcia_used_irq[s->irq.AssignedIRQ]--; 798 pcmcia_used_irq[s->pcmcia_irq]--;
810 s->irq.AssignedIRQ = 0; 799 s->pcmcia_irq = 0;
811} 800}
812 801
813#else /* CONFIG_PCMCIA_PROBE */ 802#else /* CONFIG_PCMCIA_PROBE */
@@ -819,7 +808,7 @@ static int pcmcia_setup_isa_irq(struct pcmcia_device *p_dev, int type)
819 808
820void pcmcia_cleanup_irq(struct pcmcia_socket *s) 809void pcmcia_cleanup_irq(struct pcmcia_socket *s)
821{ 810{
822 s->irq.AssignedIRQ = 0; 811 s->pcmcia_irq = 0;
823 return; 812 return;
824} 813}
825 814
@@ -840,8 +829,8 @@ int pcmcia_setup_irq(struct pcmcia_device *p_dev)
840 return 0; 829 return 0;
841 830
842 /* already assigned? */ 831 /* already assigned? */
843 if (s->irq.AssignedIRQ) { 832 if (s->pcmcia_irq) {
844 p_dev->irq_v = s->irq.AssignedIRQ; 833 p_dev->irq_v = s->pcmcia_irq;
845 return 0; 834 return 0;
846 } 835 }
847 836
@@ -855,7 +844,7 @@ int pcmcia_setup_irq(struct pcmcia_device *p_dev)
855 844
856 /* but use the PCI irq otherwise */ 845 /* but use the PCI irq otherwise */
857 if (s->pci_irq) { 846 if (s->pci_irq) {
858 p_dev->irq_v = s->irq.AssignedIRQ = s->pci_irq; 847 p_dev->irq_v = s->pcmcia_irq = s->pci_irq;
859 return 0; 848 return 0;
860 } 849 }
861 850