Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+17 -31
+1 -1
drivers/pcmcia/bfin_cf_pcmcia.c
··· 113 113 114 114 if (bfin_cf_present(cf->cd_pfx)) { 115 115 *sp = SS_READY | SS_DETECT | SS_POWERON | SS_3VCARD; 116 - s->irq.AssignedIRQ = 0; 116 + s->pcmcia_irq = 0; 117 117 s->pci_irq = cf->irq; 118 118 119 119 } else
-1
drivers/pcmcia/cardbus.c
··· 94 94 pci_enable_bridges(bus); 95 95 pci_bus_add_devices(bus); 96 96 97 - s->irq.AssignedIRQ = s->pci_irq; 98 97 return 0; 99 98 } 100 99
-1
drivers/pcmcia/cs.c
··· 337 337 s->socket = dead_socket; 338 338 s->ops->init(s); 339 339 s->ops->set_socket(s, &s->socket); 340 - s->irq.AssignedIRQ = s->irq.Config = 0; 341 340 s->lock_count = 0; 342 341 kfree(s->fake_cis); 343 342 s->fake_cis = NULL;
+1 -1
drivers/pcmcia/omap_cf.c
··· 117 117 118 118 *sp = SS_READY | SS_DETECT | SS_POWERON | SS_3VCARD; 119 119 cf = container_of(s, struct omap_cf_socket, socket); 120 - s->irq.AssignedIRQ = 0; 120 + s->pcmcia_irq = 0; 121 121 s->pci_irq = cf->irq; 122 122 } else 123 123 *sp = 0;
+2 -2
drivers/pcmcia/pcmcia_ioctl.c
··· 351 351 if (s->state & SOCKET_CARDBUS_CONFIG) { 352 352 config->Attributes = CONF_VALID_CLIENT; 353 353 config->IntType = INT_CARDBUS; 354 - config->AssignedIRQ = s->irq.AssignedIRQ; 354 + config->AssignedIRQ = s->pcmcia_irq; 355 355 if (config->AssignedIRQ) 356 356 config->Attributes |= CONF_ENABLE_IRQ; 357 357 if (s->io[0].res) { ··· 391 391 config->ExtStatus = c->ExtStatus; 392 392 config->Present = config->CardValues = c->CardValues; 393 393 config->IRQAttributes = c->irq.Attributes; 394 - config->AssignedIRQ = s->irq.AssignedIRQ; 394 + config->AssignedIRQ = s->pcmcia_irq; 395 395 config->BasePort1 = c->io.BasePort1; 396 396 config->NumPorts1 = c->io.NumPorts1; 397 397 config->Attributes1 = c->io.Attributes1;
+10 -21
drivers/pcmcia/pcmcia_resource.c
··· 430 430 dev_dbg(&s->dev, "IRQ attributes must match assigned ones\n"); 431 431 goto out; 432 432 } 433 - if (s->irq.AssignedIRQ != req->AssignedIRQ) { 433 + if (s->pcmcia_irq != req->AssignedIRQ) { 434 434 dev_dbg(&s->dev, "IRQ must match assigned one\n"); 435 435 goto out; 436 - } 437 - if (--s->irq.Config == 0) { 438 - c->state &= ~CONFIG_IRQ_REQ; 439 436 } 440 437 441 438 if (req->Handler) ··· 530 533 if (req->Attributes & CONF_ENABLE_SPKR) 531 534 s->socket.flags |= SS_SPKR_ENA; 532 535 if (req->Attributes & CONF_ENABLE_IRQ) 533 - s->socket.io_irq = s->irq.AssignedIRQ; 536 + s->socket.io_irq = s->pcmcia_irq; 534 537 else 535 538 s->socket.io_irq = 0; 536 539 s->ops->set_socket(s, &s->socket); ··· 553 556 if (req->Present & PRESENT_IOBASE_0) 554 557 c->Option |= COR_ADDR_DECODE; 555 558 } 556 - if (c->state & CONFIG_IRQ_REQ) 559 + if (req->Attributes & CONF_ENABLE_IRQ) 557 560 if (!(c->irq.Attributes & IRQ_FORCED_PULSE)) 558 561 c->Option |= COR_LEVEL_REQ; 559 562 pcmcia_write_cis_mem(s, 1, (base + CISREG_COR)>>1, 1, &c->Option); ··· 708 711 dev_dbg(&s->dev, "Configuration is locked\n"); 709 712 goto out; 710 713 } 711 - if (c->state & CONFIG_IRQ_REQ) { 712 - dev_dbg(&s->dev, "IRQ already configured\n"); 713 - goto out; 714 - } 715 714 716 715 if (!irq) { 717 716 dev_dbg(&s->dev, "no IRQ available\n"); ··· 716 723 717 724 if (!(req->Attributes & IRQ_TYPE_DYNAMIC_SHARING)) { 718 725 req->Attributes |= IRQ_TYPE_DYNAMIC_SHARING; 719 - dev_printk(KERN_WARNING, &p_dev->dev, "pcmcia: " 720 - "request for exclusive IRQ could not be fulfilled.\n"); 721 726 dev_printk(KERN_WARNING, &p_dev->dev, "pcmcia: the driver " 722 727 "needs updating to supported shared IRQ lines.\n"); 723 728 } ··· 732 741 733 742 c->irq.Attributes = req->Attributes; 734 743 req->AssignedIRQ = irq; 735 - s->irq.Config++; 736 744 737 - c->state |= CONFIG_IRQ_REQ; 738 745 p_dev->_irq = 1; 739 746 740 747 ret = 0; ··· 784 795 p_dev); 785 796 if (!ret) { 786 797 free_irq(irq, p_dev); 787 - p_dev->irq_v = s->irq.AssignedIRQ = irq; 798 + p_dev->irq_v = s->pcmcia_irq = irq; 788 799 pcmcia_used_irq[irq]++; 789 800 break; 790 801 } ··· 795 806 796 807 void pcmcia_cleanup_irq(struct pcmcia_socket *s) 797 808 { 798 - pcmcia_used_irq[s->irq.AssignedIRQ]--; 799 - s->irq.AssignedIRQ = 0; 809 + pcmcia_used_irq[s->pcmcia_irq]--; 810 + s->pcmcia_irq = 0; 800 811 } 801 812 802 813 #else /* CONFIG_PCMCIA_PROBE */ ··· 808 819 809 820 void pcmcia_cleanup_irq(struct pcmcia_socket *s) 810 821 { 811 - s->irq.AssignedIRQ = 0; 822 + s->pcmcia_irq = 0; 812 823 return; 813 824 } 814 825 ··· 829 840 return 0; 830 841 831 842 /* already assigned? */ 832 - if (s->irq.AssignedIRQ) { 833 - p_dev->irq_v = s->irq.AssignedIRQ; 843 + if (s->pcmcia_irq) { 844 + p_dev->irq_v = s->pcmcia_irq; 834 845 return 0; 835 846 } 836 847 ··· 844 855 845 856 /* but use the PCI irq otherwise */ 846 857 if (s->pci_irq) { 847 - p_dev->irq_v = s->irq.AssignedIRQ = s->pci_irq; 858 + p_dev->irq_v = s->pcmcia_irq = s->pci_irq; 848 859 return 0; 849 860 } 850 861
+3 -4
include/pcmcia/ss.h
··· 141 141 u_short lock_count; 142 142 pccard_mem_map cis_mem; 143 143 void __iomem *cis_virt; 144 - struct { 145 - u_int AssignedIRQ; 146 - u_int Config; 147 - } irq; 148 144 io_window_t io[MAX_IO_WIN]; 149 145 pccard_mem_map win[MAX_WIN]; 150 146 struct list_head cis_cache; ··· 230 234 231 235 /* non-zero if PCMCIA card is present */ 232 236 atomic_t present; 237 + 238 + /* IRQ to be used by PCMCIA devices. May not be IRQ 0. */ 239 + unsigned int pcmcia_irq; 233 240 234 241 #ifdef CONFIG_PCMCIA_IOCTL 235 242 struct user_info_t *user;