From: Dominik Brodowski <linux@dominikbrodowski.de>

As its just one pin which can be used for IRQs on PCMCIA/CardBus cards, and
only the _socket drivers_ care with which IRQ this pin is connected, only the
socket drivers (assisted by the PCCARD core) should care about which IRQ to
use.  Therefore, ignore the information passed to pcmcia_request_irq() in
IRQInfo2.  In additional patches, all in-kernel users of IRQInfo2 will be
removed; users wishing to influence the usage of IRQs can do so by modifying
several driver's irq_mask parameter and/or by adding "exclude irq 3" to
/etc/pcmcia/config.opts.  Note that a new sysfs-based interface to do so will
be added in subsequent patches.

Signed-off-by: Dominik Brodowski <linux@brodo.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/drivers/pcmcia/cs.c |   37 +++++++++++++++----------------------
 25-akpm/include/pcmcia/cs.h |    2 +-
 2 files changed, 16 insertions(+), 23 deletions(-)

diff -puN drivers/pcmcia/cs.c~pcmcia-ignore-driver-irq-mask drivers/pcmcia/cs.c
--- 25/drivers/pcmcia/cs.c~pcmcia-ignore-driver-irq-mask	Tue Jan 11 14:12:12 2005
+++ 25-akpm/drivers/pcmcia/cs.c	Tue Jan 11 14:12:12 2005
@@ -1551,30 +1551,23 @@ int pcmcia_request_irq(client_handle_t h
 	return CS_IN_USE;
 
 #ifdef CONFIG_PCMCIA_PROBE
-    if (s->irq.AssignedIRQ != 0) {
-	/* If the interrupt is already assigned, it must match */
-	irq = s->irq.AssignedIRQ;
-	if (req->IRQInfo1 & IRQ_INFO2_VALID) {
-	    u_int mask = req->IRQInfo2 & s->irq_mask;
-	    ret = ((mask >> irq) & 1) ? 0 : CS_BAD_ARGS;
-	} else
-	    ret = ((req->IRQInfo1&IRQ_MASK) == irq) ? 0 : CS_BAD_ARGS;
-    } else {
-	if (req->IRQInfo1 & IRQ_INFO2_VALID) {
-	    u_int try, mask = req->IRQInfo2 & s->irq_mask;
-	    for (try = 0; try < 2; try++) {
-		for (irq = 0; irq < 32; irq++)
-		    if ((mask >> irq) & 1) {
-			ret = try_irq(req->Attributes, irq, try);
-			if (ret == 0) break;
-		    }
-		if (ret == 0) break;
-	    }
+	if (s->irq.AssignedIRQ != 0) {
+		/* If the interrupt is already assigned, it must be the same */
+		irq = s->irq.AssignedIRQ;
 	} else {
-	    irq = req->IRQInfo1 & IRQ_MASK;
-	    ret = try_irq(req->Attributes, irq, 1);
+		u_int try, mask = s->irq_mask;
+		for (try = 0; try < 2; try++) {
+			for (irq = 0; irq < 32; irq++) {
+				if ((mask >> irq) & 1) {
+					ret = try_irq(req->Attributes, irq, try);
+					if (!ret)
+						break;
+				}
+			}
+			if (!ret)
+				break;
+		}
 	}
-    }
 #endif
     if (ret != 0) {
 	if (!s->pci_irq)
diff -puN include/pcmcia/cs.h~pcmcia-ignore-driver-irq-mask include/pcmcia/cs.h
--- 25/include/pcmcia/cs.h~pcmcia-ignore-driver-irq-mask	Tue Jan 11 14:12:12 2005
+++ 25-akpm/include/pcmcia/cs.h	Tue Jan 11 14:12:12 2005
@@ -191,7 +191,7 @@ typedef struct io_req_t {
 typedef struct irq_req_t {
     u_int	Attributes;
     u_int	AssignedIRQ;
-    u_int	IRQInfo1, IRQInfo2;
+    u_int	IRQInfo1, IRQInfo2; /* IRQInfo2 is ignored */
     void	*Handler;
     void	*Instance;
 } irq_req_t;
_