pcmcia: soc_common: ignore invalid interrupts

If gpiod_to_irq() returns an invalid interrupt, we should not try to use
it as an interrupt number.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
This commit is contained in:
Russell King 2016-08-31 11:17:50 +01:00
parent 45ca7536d4
commit a494119123

View File

@ -179,10 +179,12 @@ static int soc_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
if (skt->stat[i].desc) {
int irq = gpiod_to_irq(skt->stat[i].desc);
if (i == SOC_STAT_RDY)
skt->socket.pci_irq = irq;
else
skt->stat[i].irq = irq;
if (irq > 0) {
if (i == SOC_STAT_RDY)
skt->socket.pci_irq = irq;
else
skt->stat[i].irq = irq;
}
}
if (skt->stat[i].irq) {