[PATCH] pcmcia: soc-common: remove incorrect NO_IRQ use

Arnd Bergmann arnd at arndb.de
Tue Sep 6 06:06:01 PDT 2016

The soc_common driver (used on ARM sa1100 and pxa) initializes the
socket->pci_irq member to NO_IRQ by default to signify an invalid
interrupt, and normally overrides this with a proper interrupt later.

However, the code that checks socked->pci_irq for validity compares
it to zero instead of NO_IRQ, as most drivers do, so this cannot
work right. While zero is a valid interrupt number on PXA (and
in the past also on sa1100), it is the interrupt line for the 'ssp'
serial port, so there is no possible conflict in practice and
we can simply change the default to zero.

Signed-off-by: Arnd Bergmann <arnd at arndb.de>
 drivers/pcmcia/soc_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c
index eed5e9c05353..339ce29fa97b 100644
--- a/drivers/pcmcia/soc_common.c
+++ b/drivers/pcmcia/soc_common.c
@@ -691,7 +691,7 @@ void soc_pcmcia_init_one(struct soc_pcmcia_socket *skt,
 	skt->ops = ops;
 	skt->socket.owner = ops->owner;
 	skt->socket.dev.parent = dev;
-	skt->socket.pci_irq = NO_IRQ;
+	skt->socket.pci_irq = 0;
 	for (i = 0; i < ARRAY_SIZE(skt->stat); i++)
 		skt->stat[i].gpio = -EINVAL;

More information about the linux-pcmcia mailing list