Commit a4941191 authored by Russell King's avatar Russell King

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: default avatarRussell King <rmk+kernel@armlinux.org.uk>
parent 45ca7536
...@@ -179,10 +179,12 @@ static int soc_pcmcia_hw_init(struct soc_pcmcia_socket *skt) ...@@ -179,10 +179,12 @@ static int soc_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
if (skt->stat[i].desc) { if (skt->stat[i].desc) {
int irq = gpiod_to_irq(skt->stat[i].desc); int irq = gpiod_to_irq(skt->stat[i].desc);
if (i == SOC_STAT_RDY) if (irq > 0) {
skt->socket.pci_irq = irq; if (i == SOC_STAT_RDY)
else skt->socket.pci_irq = irq;
skt->stat[i].irq = irq; else
skt->stat[i].irq = irq;
}
} }
if (skt->stat[i].irq) { if (skt->stat[i].irq) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment