aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/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/char/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/char/pcmcia')
-rw-r--r--drivers/char/pcmcia/ipwireless/main.c11
-rw-r--r--drivers/char/pcmcia/synclink_cs.c12
2 files changed, 5 insertions, 18 deletions
diff --git a/drivers/char/pcmcia/ipwireless/main.c b/drivers/char/pcmcia/ipwireless/main.c
index dff24dae1485..2237890bc256 100644
--- a/drivers/char/pcmcia/ipwireless/main.c
+++ b/drivers/char/pcmcia/ipwireless/main.c
@@ -195,9 +195,6 @@ static int config_ipwireless(struct ipw_dev *ipw)
195 link->conf.Attributes = CONF_ENABLE_IRQ; 195 link->conf.Attributes = CONF_ENABLE_IRQ;
196 link->conf.IntType = INT_MEMORY_AND_IO; 196 link->conf.IntType = INT_MEMORY_AND_IO;
197 197
198 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
199 link->irq.Handler = ipwireless_interrupt;
200
201 INIT_WORK(&ipw->work_reboot, signalled_reboot_work); 198 INIT_WORK(&ipw->work_reboot, signalled_reboot_work);
202 199
203 ipwireless_init_hardware_v1(ipw->hardware, link->io.BasePort1, 200 ipwireless_init_hardware_v1(ipw->hardware, link->io.BasePort1,
@@ -205,8 +202,7 @@ static int config_ipwireless(struct ipw_dev *ipw)
205 ipw->is_v2_card, signalled_reboot_callback, 202 ipw->is_v2_card, signalled_reboot_callback,
206 ipw); 203 ipw);
207 204
208 ret = pcmcia_request_irq(link, &link->irq); 205 ret = pcmcia_request_irq(link, ipwireless_interrupt);
209
210 if (ret != 0) 206 if (ret != 0)
211 goto exit; 207 goto exit;
212 208
@@ -217,7 +213,7 @@ static int config_ipwireless(struct ipw_dev *ipw)
217 (unsigned int) link->io.BasePort1, 213 (unsigned int) link->io.BasePort1,
218 (unsigned int) (link->io.BasePort1 + 214 (unsigned int) (link->io.BasePort1 +
219 link->io.NumPorts1 - 1), 215 link->io.NumPorts1 - 1),
220 (unsigned int) link->irq.AssignedIRQ); 216 (unsigned int) link->irq);
221 if (ipw->attr_memory && ipw->common_memory) 217 if (ipw->attr_memory && ipw->common_memory)
222 printk(KERN_INFO IPWIRELESS_PCCARD_NAME 218 printk(KERN_INFO IPWIRELESS_PCCARD_NAME
223 ": attr memory 0x%08lx-0x%08lx, common memory 0x%08lx-0x%08lx\n", 219 ": attr memory 0x%08lx-0x%08lx, common memory 0x%08lx-0x%08lx\n",
@@ -271,8 +267,6 @@ exit:
271 267
272static void release_ipwireless(struct ipw_dev *ipw) 268static void release_ipwireless(struct ipw_dev *ipw)
273{ 269{
274 pcmcia_disable_device(ipw->link);
275
276 if (ipw->common_memory) { 270 if (ipw->common_memory) {
277 release_mem_region(ipw->request_common_memory.Base, 271 release_mem_region(ipw->request_common_memory.Base,
278 ipw->request_common_memory.Size); 272 ipw->request_common_memory.Size);
@@ -288,7 +282,6 @@ static void release_ipwireless(struct ipw_dev *ipw)
288 if (ipw->attr_memory) 282 if (ipw->attr_memory)
289 pcmcia_release_window(ipw->link, ipw->handle_attr_memory); 283 pcmcia_release_window(ipw->link, ipw->handle_attr_memory);
290 284
291 /* Break the link with Card Services */
292 pcmcia_disable_device(ipw->link); 285 pcmcia_disable_device(ipw->link);
293} 286}
294 287
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index c31a0d913d37..027690b70d2c 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -552,10 +552,6 @@ static int mgslpc_probe(struct pcmcia_device *link)
552 552
553 /* Initialize the struct pcmcia_device structure */ 553 /* Initialize the struct pcmcia_device structure */
554 554
555 /* Interrupt setup */
556 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
557 link->irq.Handler = NULL;
558
559 link->conf.Attributes = 0; 555 link->conf.Attributes = 0;
560 link->conf.IntType = INT_MEMORY_AND_IO; 556 link->conf.IntType = INT_MEMORY_AND_IO;
561 557
@@ -608,9 +604,7 @@ static int mgslpc_config(struct pcmcia_device *link)
608 link->conf.ConfigIndex = 8; 604 link->conf.ConfigIndex = 8;
609 link->conf.Present = PRESENT_OPTION; 605 link->conf.Present = PRESENT_OPTION;
610 606
611 link->irq.Handler = mgslpc_isr; 607 ret = pcmcia_request_irq(link, mgslpc_isr);
612
613 ret = pcmcia_request_irq(link, &link->irq);
614 if (ret) 608 if (ret)
615 goto failed; 609 goto failed;
616 ret = pcmcia_request_configuration(link, &link->conf); 610 ret = pcmcia_request_configuration(link, &link->conf);
@@ -618,7 +612,7 @@ static int mgslpc_config(struct pcmcia_device *link)
618 goto failed; 612 goto failed;
619 613
620 info->io_base = link->io.BasePort1; 614 info->io_base = link->io.BasePort1;
621 info->irq_level = link->irq.AssignedIRQ; 615 info->irq_level = link->irq;
622 616
623 /* add to linked list of devices */ 617 /* add to linked list of devices */
624 sprintf(info->node.dev_name, "mgslpc0"); 618 sprintf(info->node.dev_name, "mgslpc0");
@@ -628,7 +622,7 @@ static int mgslpc_config(struct pcmcia_device *link)
628 printk(KERN_INFO "%s: index 0x%02x:", 622 printk(KERN_INFO "%s: index 0x%02x:",
629 info->node.dev_name, link->conf.ConfigIndex); 623 info->node.dev_name, link->conf.ConfigIndex);
630 if (link->conf.Attributes & CONF_ENABLE_IRQ) 624 if (link->conf.Attributes & CONF_ENABLE_IRQ)
631 printk(", irq %d", link->irq.AssignedIRQ); 625 printk(", irq %d", link->irq);
632 if (link->io.NumPorts1) 626 if (link->io.NumPorts1)
633 printk(", io 0x%04x-0x%04x", link->io.BasePort1, 627 printk(", io 0x%04x-0x%04x", link->io.BasePort1,
634 link->io.BasePort1+link->io.NumPorts1-1); 628 link->io.BasePort1+link->io.NumPorts1-1);