[PATCH] pcmcia: Add pcmcia_request_threaded_irq()

Takashi Iwai tiwai at suse.de
Tue Sep 9 09:20:21 PDT 2014


Allow pcmcia drivers to use threaded irq handlers.  The existing
pcmcia_request_irq() helper is calling the new function just with
NULL thread_fn.

Signed-off-by: Takashi Iwai <tiwai at suse.de>
---

The threaded irq will be used by the rewrite of snd-vxpocket driver.

 drivers/pcmcia/pcmcia_resource.c | 11 ++++++-----
 include/pcmcia/ds.h              |  7 +++++--
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index e8c19def1b0f..5c2039125aff 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -695,22 +695,23 @@ EXPORT_SYMBOL(pcmcia_request_io);
  * call free_irq() themselfves, too. Also, only %IRQF_SHARED capable IRQ
  * handlers are allowed.
  */
-int __must_check pcmcia_request_irq(struct pcmcia_device *p_dev,
-				    irq_handler_t handler)
+int __must_check pcmcia_request_threaded_irq(struct pcmcia_device *p_dev,
+					     irq_handler_t handler,
+					     irq_handler_t thread_fn)
 {
 	int ret;
 
 	if (!p_dev->irq)
 		return -EINVAL;
 
-	ret = request_irq(p_dev->irq, handler, IRQF_SHARED,
-			p_dev->devname, p_dev->priv);
+	ret = request_threaded_irq(p_dev->irq, handler, thread_fn, IRQF_SHARED,
+				   p_dev->devname, p_dev->priv);
 	if (!ret)
 		p_dev->_irq = 1;
 
 	return ret;
 }
-EXPORT_SYMBOL(pcmcia_request_irq);
+EXPORT_SYMBOL(pcmcia_request_threaded_irq);
 
 
 /**
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index 2d56e428506c..6ff5524bec12 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -216,8 +216,11 @@ pcmcia_request_exclusive_irq(struct pcmcia_device *p_dev,
 	return __pcmcia_request_exclusive_irq(p_dev, handler);
 }
 
-int __must_check pcmcia_request_irq(struct pcmcia_device *p_dev,
-				irq_handler_t handler);
+int __must_check pcmcia_request_threaded_irq(struct pcmcia_device *p_dev,
+					     irq_handler_t handler,
+					     irq_handler_t thread_fn);
+#define pcmcia_request_irq(pdev, handler) \
+	pcmcia_request_threaded_irq(pdev, handler, NULL)
 
 int pcmcia_enable_device(struct pcmcia_device *p_dev);
 
-- 
2.1.0




More information about the linux-pcmcia mailing list