From: Paul Mackerras <paulus@samba.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linuxppc-dev@ozlabs.org
Subject: [PATCH] Make snd-aoa cope with lack of line-output-detect property
Date: Mon, 10 Jul 2006 22:39:47 +1000 [thread overview]
Message-ID: <17586.19091.512322.908434@cargo.ozlabs.ibm.com> (raw)
The snd-aoa stuff falls over on my G4 powerbook (1.5GHz Albook) with a
null pointer dereference in of_find_property. It turns out that this
was because it couldn't find a device node for the line-output detect
GPIO. This patch fixes it.
Signed-off-by: Paul Mackerras <paulus@samba.org>
---
diff --git a/sound/aoa/core/snd-aoa-gpio-feature.c b/sound/aoa/core/snd-aoa-gpio-feature.c
index 7ae0c0b..e35a1c6 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
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 = -1; /* XXX should this be NO_IRQ? */
}
/* 0x4 is outenable, 0x1 is out, thus 4 or 5 */
@@ -322,7 +325,7 @@ static int ftr_set_notify(struct gpio_ru
return -EINVAL;
}
- if (irq == -1)
+ if (irq == -1) /* XXX should this be NO_IRQ? */
return -ENODEV;
mutex_lock(¬if->mutex);
next reply other threads:[~2006-07-10 12:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-10 12:39 Paul Mackerras [this message]
2006-07-10 13:11 ` [PATCH] Make snd-aoa cope with lack of line-output-detect property Johannes Berg
2006-07-10 21:19 ` Benjamin Herrenschmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=17586.19091.512322.908434@cargo.ozlabs.ibm.com \
--to=paulus@samba.org \
--cc=johannes@sipsolutions.net \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).