From b370820787c50feefad6c3a1654ae937162f8540 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Sat, 27 Jun 1998 22:42:23 +0000 Subject: make isa_intr_establish not panic, but return NULL for failure --- sys/arch/i386/isa/isa_machdep.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/sys/arch/i386/isa/isa_machdep.c b/sys/arch/i386/isa/isa_machdep.c index fd641539bb1..d702b62e2ab 100644 --- a/sys/arch/i386/isa/isa_machdep.c +++ b/sys/arch/i386/isa/isa_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isa_machdep.c,v 1.28 1998/02/22 21:35:30 niklas Exp $ */ +/* $OpenBSD: isa_machdep.c,v 1.29 1998/06/27 22:42:22 deraadt Exp $ */ /* $NetBSD: isa_machdep.c,v 1.22 1997/06/12 23:57:32 thorpej Exp $ */ #define ISA_DMA_STATS @@ -464,12 +464,16 @@ isa_intr_establish(ic, irq, type, level, ih_fun, ih_arg, ih_what) /* no point in sleeping unless someone can free memory. */ ih = malloc(sizeof *ih, M_DEVBUF, cold ? M_NOWAIT : M_WAITOK); - if (ih == NULL) - panic("isa_intr_establish: can't malloc handler info"); - - if (!LEGAL_IRQ(irq) || type == IST_NONE) - panic("intr_establish: bogus irq or type"); + if (ih == NULL) { + printf("%s: isa_intr_establish: can't malloc handler info\n", + ih_what); + return NULL; + } + if (!LEGAL_IRQ(irq) || type == IST_NONE) { + printf("%s: intr_establish: bogus irq or type\n", ih_what); + return NULL; + } switch (intrtype[irq]) { case IST_NONE: intrtype[irq] = type; @@ -479,10 +483,12 @@ isa_intr_establish(ic, irq, type, level, ih_fun, ih_arg, ih_what) if (type == intrtype[irq]) break; case IST_PULSE: - if (type != IST_NONE) - panic("intr_establish: can't share %s with %s, irq %d", - isa_intr_typename(intrtype[irq]), - isa_intr_typename(type), irq); + if (type != IST_NONE) { + /*printf("%s: intr_establish: can't share %s with %s, irq %d\n", + ih_what, isa_intr_typename(intrtype[irq]), + isa_intr_typename(type), irq);*/ + return NULL; + } break; } -- cgit v1.2.3