[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: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>

authored by Johannes Berg and committed by Jaroslav Kysela 2566d36a 59feddb2

+5 -2
+5 -2
sound/aoa/core/snd-aoa-gpio-feature.c
··· 112 113 static void get_irq(struct device_node * np, int *irqptr) 114 { 115 - *irqptr = irq_of_parse_and_map(np, 0); 116 } 117 118 /* 0x4 is outenable, 0x1 is out, thus 4 or 5 */ ··· 325 return -EINVAL; 326 } 327 328 - if (irq == -1) 329 return -ENODEV; 330 331 mutex_lock(&notif->mutex);
··· 112 113 static void get_irq(struct device_node * np, int *irqptr) 114 { 115 + if (np) 116 + *irqptr = irq_of_parse_and_map(np, 0); 117 + else 118 + *irqptr = NO_IRQ; 119 } 120 121 /* 0x4 is outenable, 0x1 is out, thus 4 or 5 */ ··· 322 return -EINVAL; 323 } 324 325 + if (irq == NO_IRQ) 326 return -ENODEV; 327 328 mutex_lock(&notif->mutex);