aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--drivers/pcmcia/bfin_cf_pcmcia.c2
-rw-r--r--drivers/pcmcia/cardbus.c1
-rw-r--r--drivers/pcmcia/cs.c1
-rw-r--r--drivers/pcmcia/omap_cf.c2
-rw-r--r--drivers/pcmcia/pcmcia_ioctl.c4
-rw-r--r--drivers/pcmcia/pcmcia_resource.c31
-rw-r--r--include/pcmcia/ss.h7
7 files changed, 17 insertions, 31 deletions
diff --git a/drivers/pcmcia/bfin_cf_pcmcia.c b/drivers/pcmcia/bfin_cf_pcmcia.c
index 9e84d039de41..eae9cbe37a3e 100644
--- a/drivers/pcmcia/bfin_cf_pcmcia.c
+++ b/drivers/pcmcia/bfin_cf_pcmcia.c
@@ -113,7 +113,7 @@ static int bfin_cf_get_status(struct pcmcia_socket *s, u_int *sp)
113 113
114 if (bfin_cf_present(cf->cd_pfx)) { 114 if (bfin_cf_present(cf->cd_pfx)) {
115 *sp = SS_READY | SS_DETECT | SS_POWERON | SS_3VCARD; 115 *sp = SS_READY | SS_DETECT | SS_POWERON | SS_3VCARD;
116 s->irq.AssignedIRQ = 0; 116 s->pcmcia_irq = 0;
117 s->pci_irq = cf->irq; 117 s->pci_irq = cf->irq;
118 118
119 } else 119 } else
diff --git a/drivers/pcmcia/cardbus.c b/drivers/pcmcia/cardbus.c
index e6ab2a47d8cb..9a58862f1401 100644
--- a/drivers/pcmcia/cardbus.c
+++ b/drivers/pcmcia/cardbus.c
@@ -94,7 +94,6 @@ int __ref cb_alloc(struct pcmcia_socket *s)
94 pci_enable_bridges(bus); 94 pci_enable_bridges(bus);
95 pci_bus_add_devices(bus); 95 pci_bus_add_devices(bus);
96 96
97 s->irq.AssignedIRQ = s->pci_irq;
98 return 0; 97 return 0;
99} 98}
100 99
diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
index c3383750e333..976d80706eae 100644
--- a/drivers/pcmcia/cs.c
+++ b/drivers/pcmcia/cs.c
@@ -337,7 +337,6 @@ static void socket_shutdown(struct pcmcia_socket *s)
337 s->socket = dead_socket; 337 s->socket = dead_socket;
338 s->ops->init(s); 338 s->ops->init(s);
339 s->ops->set_socket(s, &s->socket); 339 s->ops->set_socket(s, &s->socket);
340 s->irq.AssignedIRQ = s->irq.Config = 0;
341 s->lock_count = 0; 340 s->lock_count = 0;
342 kfree(s->fake_cis); 341 kfree(s->fake_cis);
343 s->fake_cis = NULL; 342 s->fake_cis = NULL;
diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c
index a7cfc7964c7c..0ad06a3bd562 100644
--- a/drivers/pcmcia/omap_cf.c
+++ b/drivers/pcmcia/omap_cf.c
@@ -117,7 +117,7 @@ static int omap_cf_get_status(struct pcmcia_socket *s, u_int *sp)
117 117
118 *sp = SS_READY | SS_DETECT | SS_POWERON | SS_3VCARD; 118 *sp = SS_READY | SS_DETECT | SS_POWERON | SS_3VCARD;
119 cf = container_of(s, struct omap_cf_socket, socket); 119 cf = container_of(s, struct omap_cf_socket, socket);
120 s->irq.AssignedIRQ = 0; 120 s->pcmcia_irq = 0;
121 s->pci_irq = cf->irq; 121 s->pci_irq = cf->irq;
122 } else 122 } else
123 *sp = 0; 123 *sp = 0;
diff --git a/drivers/pcmcia/pcmcia_ioctl.c b/drivers/pcmcia/pcmcia_ioctl.c
index 7631faa0cadd..fe98aa9b1aef 100644
--- a/drivers/pcmcia/pcmcia_ioctl.c
+++ b/drivers/pcmcia/pcmcia_ioctl.c
@@ -351,7 +351,7 @@ static int pccard_get_configuration_info(struct pcmcia_socket *s,
351 if (s->state & SOCKET_CARDBUS_CONFIG) { 351 if (s->state & SOCKET_CARDBUS_CONFIG) {
352 config->Attributes = CONF_VALID_CLIENT; 352 config->Attributes = CONF_VALID_CLIENT;
353 config->IntType = INT_CARDBUS; 353 config->IntType = INT_CARDBUS;
354 config->AssignedIRQ = s->irq.AssignedIRQ; 354 config->AssignedIRQ = s->pcmcia_irq;
355 if (config->AssignedIRQ) 355 if (config->AssignedIRQ)
356 config->Attributes |= CONF_ENABLE_IRQ; 356 config->Attributes |= CONF_ENABLE_IRQ;
357 if (s->io[0].res) { 357 if (s->io[0].res) {
@@ -391,7 +391,7 @@ static int pccard_get_configuration_info(struct pcmcia_socket *s,
391 config->ExtStatus = c->ExtStatus; 391 config->ExtStatus = c->ExtStatus;
392 config->Present = config->CardValues = c->CardValues; 392 config->Present = config->CardValues = c->CardValues;
393 config->IRQAttributes = c->irq.Attributes; 393 config->IRQAttributes = c->irq.Attributes;
394 config->AssignedIRQ = s->irq.AssignedIRQ; 394 config->AssignedIRQ = s->pcmcia_irq;
395 config->BasePort1 = c->io.BasePort1; 395 config->BasePort1 = c->io.BasePort1;
396 config->NumPorts1 = c->io.NumPorts1; 396 config->NumPorts1 = c->io.NumPorts1;
397 config->Attributes1 = c->io.Attributes1; 397 config->Attributes1 = c->io.Attributes1;
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
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index 344705cb42f4..764281b29218 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -141,10 +141,6 @@ struct pcmcia_socket {
141 u_short lock_count; 141 u_short lock_count;
142 pccard_mem_map cis_mem; 142 pccard_mem_map cis_mem;
143 void __iomem *cis_virt; 143 void __iomem *cis_virt;
144 struct {
145 u_int AssignedIRQ;
146 u_int Config;
147 } irq;
148 io_window_t io[MAX_IO_WIN]; 144 io_window_t io[MAX_IO_WIN];
149 pccard_mem_map win[MAX_WIN]; 145 pccard_mem_map win[MAX_WIN];
150 struct list_head cis_cache; 146 struct list_head cis_cache;
@@ -235,6 +231,9 @@ struct pcmcia_socket {
235 /* non-zero if PCMCIA card is present */ 231 /* non-zero if PCMCIA card is present */
236 atomic_t present; 232 atomic_t present;
237 233
234 /* IRQ to be used by PCMCIA devices. May not be IRQ 0. */
235 unsigned int pcmcia_irq;
236
238#ifdef CONFIG_PCMCIA_IOCTL 237#ifdef CONFIG_PCMCIA_IOCTL
239 struct user_info_t *user; 238 struct user_info_t *user;
240 wait_queue_head_t queue; 239 wait_queue_head_t queue;