diff options
| author | Johannes Berg <johannes@sipsolutions.net> | 2006-07-25 10:12:51 -0400 |
|---|---|---|
| committer | Jaroslav Kysela <perex@suse.cz> | 2006-08-03 09:21:20 -0400 |
| commit | 2566d36ab4f0b90141bb59a5f7342255751fbf45 (patch) | |
| tree | 086251f284de9f559235164e3ab0594e6456b2ec /sound/aoa | |
| parent | 59feddb25f9d925e86ee22596802405788bc050f (diff) | |
[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>
Diffstat (limited to 'sound/aoa')
| -rw-r--r-- | sound/aoa/core/snd-aoa-gpio-feature.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sound/aoa/core/snd-aoa-gpio-feature.c b/sound/aoa/core/snd-aoa-gpio-feature.c index 7ae0c0bdfad8..f69d33357a28 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, | |||
| 112 | 112 | ||
| 113 | static void get_irq(struct device_node * np, int *irqptr) | 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 | /* 0x4 is outenable, 0x1 is out, thus 4 or 5 */ | 121 | /* 0x4 is outenable, 0x1 is out, thus 4 or 5 */ |
| @@ -322,7 +325,7 @@ static int ftr_set_notify(struct gpio_runtime *rt, | |||
| 322 | return -EINVAL; | 325 | return -EINVAL; |
| 323 | } | 326 | } |
| 324 | 327 | ||
| 325 | if (irq == -1) | 328 | if (irq == NO_IRQ) |
| 326 | return -ENODEV; | 329 | return -ENODEV; |
| 327 | 330 | ||
| 328 | mutex_lock(¬if->mutex); | 331 | mutex_lock(¬if->mutex); |
