aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pcmcia
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/scsi/pcmcia
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/scsi/pcmcia')
-rw-r--r--drivers/scsi/pcmcia/aha152x_stub.c6
-rw-r--r--drivers/scsi/pcmcia/fdomain_stub.c6
-rw-r--r--drivers/scsi/pcmcia/nsp_cs.c20
-rw-r--r--drivers/scsi/pcmcia/qlogic_stub.c10
-rw-r--r--drivers/scsi/pcmcia/sym53c500_cs.c6
5 files changed, 15 insertions, 33 deletions
diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c
index 528733b4a392..c1de4ba1f0a5 100644
--- a/drivers/scsi/pcmcia/aha152x_stub.c
+++ b/drivers/scsi/pcmcia/aha152x_stub.c
@@ -105,7 +105,6 @@ static int aha152x_probe(struct pcmcia_device *link)
105 link->io.NumPorts1 = 0x20; 105 link->io.NumPorts1 = 0x20;
106 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 106 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
107 link->io.IOAddrLines = 10; 107 link->io.IOAddrLines = 10;
108 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
109 link->conf.Attributes = CONF_ENABLE_IRQ; 108 link->conf.Attributes = CONF_ENABLE_IRQ;
110 link->conf.IntType = INT_MEMORY_AND_IO; 109 link->conf.IntType = INT_MEMORY_AND_IO;
111 link->conf.Present = PRESENT_OPTION; 110 link->conf.Present = PRESENT_OPTION;
@@ -160,8 +159,7 @@ static int aha152x_config_cs(struct pcmcia_device *link)
160 if (ret) 159 if (ret)
161 goto failed; 160 goto failed;
162 161
163 ret = pcmcia_request_irq(link, &link->irq); 162 if (!link->irq)
164 if (ret)
165 goto failed; 163 goto failed;
166 164
167 ret = pcmcia_request_configuration(link, &link->conf); 165 ret = pcmcia_request_configuration(link, &link->conf);
@@ -172,7 +170,7 @@ static int aha152x_config_cs(struct pcmcia_device *link)
172 memset(&s, 0, sizeof(s)); 170 memset(&s, 0, sizeof(s));
173 s.conf = "PCMCIA setup"; 171 s.conf = "PCMCIA setup";
174 s.io_port = link->io.BasePort1; 172 s.io_port = link->io.BasePort1;
175 s.irq = link->irq.AssignedIRQ; 173 s.irq = link->irq;
176 s.scsiid = host_id; 174 s.scsiid = host_id;
177 s.reconnect = reconnect; 175 s.reconnect = reconnect;
178 s.parity = parity; 176 s.parity = parity;
diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c
index 914040684079..8cb6d71f0204 100644
--- a/drivers/scsi/pcmcia/fdomain_stub.c
+++ b/drivers/scsi/pcmcia/fdomain_stub.c
@@ -88,7 +88,6 @@ static int fdomain_probe(struct pcmcia_device *link)
88 link->io.NumPorts1 = 0x10; 88 link->io.NumPorts1 = 0x10;
89 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 89 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
90 link->io.IOAddrLines = 10; 90 link->io.IOAddrLines = 10;
91 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
92 link->conf.Attributes = CONF_ENABLE_IRQ; 91 link->conf.Attributes = CONF_ENABLE_IRQ;
93 link->conf.IntType = INT_MEMORY_AND_IO; 92 link->conf.IntType = INT_MEMORY_AND_IO;
94 link->conf.Present = PRESENT_OPTION; 93 link->conf.Present = PRESENT_OPTION;
@@ -133,8 +132,7 @@ static int fdomain_config(struct pcmcia_device *link)
133 if (ret) 132 if (ret)
134 goto failed; 133 goto failed;
135 134
136 ret = pcmcia_request_irq(link, &link->irq); 135 if (!link->irq)
137 if (ret)
138 goto failed; 136 goto failed;
139 ret = pcmcia_request_configuration(link, &link->conf); 137 ret = pcmcia_request_configuration(link, &link->conf);
140 if (ret) 138 if (ret)
@@ -144,7 +142,7 @@ static int fdomain_config(struct pcmcia_device *link)
144 release_region(link->io.BasePort1, link->io.NumPorts1); 142 release_region(link->io.BasePort1, link->io.NumPorts1);
145 143
146 /* Set configuration options for the fdomain driver */ 144 /* Set configuration options for the fdomain driver */
147 sprintf(str, "%d,%d", link->io.BasePort1, link->irq.AssignedIRQ); 145 sprintf(str, "%d,%d", link->io.BasePort1, link->irq);
148 fdomain_setup(str); 146 fdomain_setup(str);
149 147
150 host = __fdomain_16x0_detect(&fdomain_driver_template); 148 host = __fdomain_16x0_detect(&fdomain_driver_template);
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index 021246454872..24c78ed98f07 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -1563,13 +1563,6 @@ static int nsp_cs_probe(struct pcmcia_device *link)
1563 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 1563 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
1564 link->io.IOAddrLines = 10; /* not used */ 1564 link->io.IOAddrLines = 10; /* not used */
1565 1565
1566 /* Interrupt setup */
1567 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
1568
1569 /* Interrupt handler */
1570 link->irq.Handler = &nspintr;
1571 link->irq.Attributes |= IRQF_SHARED;
1572
1573 /* General socket configuration */ 1566 /* General socket configuration */
1574 link->conf.Attributes = CONF_ENABLE_IRQ; 1567 link->conf.Attributes = CONF_ENABLE_IRQ;
1575 link->conf.IntType = INT_MEMORY_AND_IO; 1568 link->conf.IntType = INT_MEMORY_AND_IO;
@@ -1646,8 +1639,7 @@ static int nsp_cs_config_check(struct pcmcia_device *p_dev,
1646 } 1639 }
1647 1640
1648 /* Do we need to allocate an interrupt? */ 1641 /* Do we need to allocate an interrupt? */
1649 if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1) 1642 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
1650 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
1651 1643
1652 /* IO window settings */ 1644 /* IO window settings */
1653 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 1645 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
@@ -1720,10 +1712,8 @@ static int nsp_cs_config(struct pcmcia_device *link)
1720 if (ret) 1712 if (ret)
1721 goto cs_failed; 1713 goto cs_failed;
1722 1714
1723 if (link->conf.Attributes & CONF_ENABLE_IRQ) { 1715 if (pcmcia_request_irq(link, nspintr))
1724 if (pcmcia_request_irq(link, &link->irq)) 1716 goto cs_failed;
1725 goto cs_failed;
1726 }
1727 1717
1728 ret = pcmcia_request_configuration(link, &link->conf); 1718 ret = pcmcia_request_configuration(link, &link->conf);
1729 if (ret) 1719 if (ret)
@@ -1741,7 +1731,7 @@ static int nsp_cs_config(struct pcmcia_device *link)
1741 /* Set port and IRQ */ 1731 /* Set port and IRQ */
1742 data->BaseAddress = link->io.BasePort1; 1732 data->BaseAddress = link->io.BasePort1;
1743 data->NumAddress = link->io.NumPorts1; 1733 data->NumAddress = link->io.NumPorts1;
1744 data->IrqNumber = link->irq.AssignedIRQ; 1734 data->IrqNumber = link->irq;
1745 1735
1746 nsp_dbg(NSP_DEBUG_INIT, "I/O[0x%x+0x%x] IRQ %d", 1736 nsp_dbg(NSP_DEBUG_INIT, "I/O[0x%x+0x%x] IRQ %d",
1747 data->BaseAddress, data->NumAddress, data->IrqNumber); 1737 data->BaseAddress, data->NumAddress, data->IrqNumber);
@@ -1775,7 +1765,7 @@ static int nsp_cs_config(struct pcmcia_device *link)
1775 printk(", Vpp %d.%d", link->conf.Vpp/10, link->conf.Vpp%10); 1765 printk(", Vpp %d.%d", link->conf.Vpp/10, link->conf.Vpp%10);
1776 } 1766 }
1777 if (link->conf.Attributes & CONF_ENABLE_IRQ) { 1767 if (link->conf.Attributes & CONF_ENABLE_IRQ) {
1778 printk(", irq %d", link->irq.AssignedIRQ); 1768 printk(", irq %d", link->irq);
1779 } 1769 }
1780 if (link->io.NumPorts1) { 1770 if (link->io.NumPorts1) {
1781 printk(", io 0x%04x-0x%04x", link->io.BasePort1, 1771 printk(", io 0x%04x-0x%04x", link->io.BasePort1,
diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c
index f85f094870b4..c3a4428dbcff 100644
--- a/drivers/scsi/pcmcia/qlogic_stub.c
+++ b/drivers/scsi/pcmcia/qlogic_stub.c
@@ -161,7 +161,6 @@ static int qlogic_probe(struct pcmcia_device *link)
161 link->io.NumPorts1 = 16; 161 link->io.NumPorts1 = 16;
162 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 162 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
163 link->io.IOAddrLines = 10; 163 link->io.IOAddrLines = 10;
164 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
165 link->conf.Attributes = CONF_ENABLE_IRQ; 164 link->conf.Attributes = CONF_ENABLE_IRQ;
166 link->conf.IntType = INT_MEMORY_AND_IO; 165 link->conf.IntType = INT_MEMORY_AND_IO;
167 link->conf.Present = PRESENT_OPTION; 166 link->conf.Present = PRESENT_OPTION;
@@ -209,8 +208,7 @@ static int qlogic_config(struct pcmcia_device * link)
209 if (ret) 208 if (ret)
210 goto failed; 209 goto failed;
211 210
212 ret = pcmcia_request_irq(link, &link->irq); 211 if (!link->irq)
213 if (ret)
214 goto failed; 212 goto failed;
215 213
216 ret = pcmcia_request_configuration(link, &link->conf); 214 ret = pcmcia_request_configuration(link, &link->conf);
@@ -227,10 +225,10 @@ static int qlogic_config(struct pcmcia_device * link)
227 /* The KXL-810AN has a bigger IO port window */ 225 /* The KXL-810AN has a bigger IO port window */
228 if (link->io.NumPorts1 == 32) 226 if (link->io.NumPorts1 == 32)
229 host = qlogic_detect(&qlogicfas_driver_template, link, 227 host = qlogic_detect(&qlogicfas_driver_template, link,
230 link->io.BasePort1 + 16, link->irq.AssignedIRQ); 228 link->io.BasePort1 + 16, link->irq);
231 else 229 else
232 host = qlogic_detect(&qlogicfas_driver_template, link, 230 host = qlogic_detect(&qlogicfas_driver_template, link,
233 link->io.BasePort1, link->irq.AssignedIRQ); 231 link->io.BasePort1, link->irq);
234 232
235 if (!host) { 233 if (!host) {
236 printk(KERN_INFO "%s: no SCSI devices found\n", qlogic_name); 234 printk(KERN_INFO "%s: no SCSI devices found\n", qlogic_name);
@@ -258,7 +256,7 @@ static void qlogic_release(struct pcmcia_device *link)
258 256
259 scsi_remove_host(info->host); 257 scsi_remove_host(info->host);
260 258
261 free_irq(link->irq.AssignedIRQ, info->host); 259 free_irq(link->irq, info->host);
262 pcmcia_disable_device(link); 260 pcmcia_disable_device(link);
263 261
264 scsi_host_put(info->host); 262 scsi_host_put(info->host);
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c
index e7564d8f0cbf..6eacf4ca200f 100644
--- a/drivers/scsi/pcmcia/sym53c500_cs.c
+++ b/drivers/scsi/pcmcia/sym53c500_cs.c
@@ -719,8 +719,7 @@ SYM53C500_config(struct pcmcia_device *link)
719 if (ret) 719 if (ret)
720 goto failed; 720 goto failed;
721 721
722 ret = pcmcia_request_irq(link, &link->irq); 722 if (!link->irq)
723 if (ret)
724 goto failed; 723 goto failed;
725 724
726 ret = pcmcia_request_configuration(link, &link->conf); 725 ret = pcmcia_request_configuration(link, &link->conf);
@@ -752,7 +751,7 @@ SYM53C500_config(struct pcmcia_device *link)
752 * 0x320, 0x330, 0x340, 0x350 751 * 0x320, 0x330, 0x340, 0x350
753 */ 752 */
754 port_base = link->io.BasePort1; 753 port_base = link->io.BasePort1;
755 irq_level = link->irq.AssignedIRQ; 754 irq_level = link->irq;
756 755
757 DEB(printk("SYM53C500: port_base=0x%x, irq=%d, fast_pio=%d\n", 756 DEB(printk("SYM53C500: port_base=0x%x, irq=%d, fast_pio=%d\n",
758 port_base, irq_level, USE_FAST_PIO);) 757 port_base, irq_level, USE_FAST_PIO);)
@@ -866,7 +865,6 @@ SYM53C500_probe(struct pcmcia_device *link)
866 link->io.NumPorts1 = 16; 865 link->io.NumPorts1 = 16;
867 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 866 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
868 link->io.IOAddrLines = 10; 867 link->io.IOAddrLines = 10;
869 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
870 link->conf.Attributes = CONF_ENABLE_IRQ; 868 link->conf.Attributes = CONF_ENABLE_IRQ;
871 link->conf.IntType = INT_MEMORY_AND_IO; 869 link->conf.IntType = INT_MEMORY_AND_IO;
872 870