Commit 2566d36a authored by Johannes Berg's avatar Johannes Berg Committed by Jaroslav Kysela

[ALSA] aoa: feature gpio layer: fix IRQ access

The IRQ rework caused some hiccups here, in some cases we call
get_irq without a device node. This patch makes it catch that
case and return NO_IRQ when it happens, along with changing the
place where the irq is checked to check for NO_IRQ instead of -1.
Acked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
parent 59feddb2
......@@ -112,7 +112,10 @@ static struct device_node *get_gpio(char *name,
static void get_irq(struct device_node * np, int *irqptr)
{
*irqptr = irq_of_parse_and_map(np, 0);
if (np)
*irqptr = irq_of_parse_and_map(np, 0);
else
*irqptr = NO_IRQ;
}
/* 0x4 is outenable, 0x1 is out, thus 4 or 5 */
......@@ -322,7 +325,7 @@ static int ftr_set_notify(struct gpio_runtime *rt,
return -EINVAL;
}
if (irq == -1)
if (irq == NO_IRQ)
return -ENODEV;
mutex_lock(&notif->mutex);
......
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