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