linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Make snd-aoa cope with lack of line-output-detect property
@ 2006-07-10 12:39 Paul Mackerras
  2006-07-10 13:11 ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Mackerras @ 2006-07-10 12:39 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linuxppc-dev

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(&notif->mutex);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Make snd-aoa cope with lack of line-output-detect property
  2006-07-10 12:39 [PATCH] Make snd-aoa cope with lack of line-output-detect property Paul Mackerras
@ 2006-07-10 13:11 ` Johannes Berg
  2006-07-10 21:19   ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2006-07-10 13:11 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 544 bytes --]

On Mon, 2006-07-10 at 22:39 +1000, Paul Mackerras wrote:
> 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.

That's interesting. I thought I was running this code. Hmm :>

I should probably drop the get_irq function completely and do that in
line. And yes, that should be NO_IRQ I guess. I'll prepare a patch
later.

Thanks,
johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Make snd-aoa cope with lack of line-output-detect property
  2006-07-10 13:11 ` Johannes Berg
@ 2006-07-10 21:19   ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 3+ messages in thread
From: Benjamin Herrenschmidt @ 2006-07-10 21:19 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linuxppc-dev, Paul Mackerras

On Mon, 2006-07-10 at 15:11 +0200, Johannes Berg wrote:
> On Mon, 2006-07-10 at 22:39 +1000, Paul Mackerras wrote:
> > 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.
> 
> That's interesting. I thought I was running this code. Hmm :>

Slightly different model I suppose, 5,4 vs. 5,6 no ? Paul, can you send
Johannes a dumb of your device-tree ?

> I should probably drop the get_irq function completely and do that in
> line. And yes, that should be NO_IRQ I guess. I'll prepare a patch
> later.

Ben.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-07-10 21:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-10 12:39 [PATCH] Make snd-aoa cope with lack of line-output-detect property Paul Mackerras
2006-07-10 13:11 ` Johannes Berg
2006-07-10 21:19   ` Benjamin Herrenschmidt

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).