From: Johannes Berg Date: Tue, 25 Jul 2006 14:12:51 +0000 (+0200) Subject: [ALSA] aoa: feature gpio layer: fix IRQ access X-Git-Tag: v3.12-rc1~34320^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2566d36ab4f0b90141bb59a5f7342255751fbf45;p=kernel%2Fkernel-generic.git [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 Signed-off-by: Johannes Berg Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- diff --git a/sound/aoa/core/snd-aoa-gpio-feature.c b/sound/aoa/core/snd-aoa-gpio-feature.c index 7ae0c0b..f69d333 100644 --- a/sound/aoa/core/snd-aoa-gpio-feature.c +++ b/sound/aoa/core/snd-aoa-gpio-feature.c @@ -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(¬if->mutex);