diff options
| author | macallan <macallan@NetBSD.org> | 2010-02-18 02:21:38 +0000 |
|---|---|---|
| committer | macallan <macallan@NetBSD.org> | 2010-02-18 02:21:38 +0000 |
| commit | 490ba2f1c7eb22318885d7d094d9a00a20963fb0 (patch) | |
| tree | 62696c7062b38d8e3b92d2558c971d412e9018d7 /sys/dev | |
| parent | 836736c39d637c8d0d3483fb11cbfad10708117d (diff) | |
Abort setup when we find no audio codec to avoid crashing later on with
ISDN-only cards.
Should fix PR41055
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/sbus/dbri.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/dev/sbus/dbri.c b/sys/dev/sbus/dbri.c index 6fb1f756135..2e7122b6158 100644 --- a/sys/dev/sbus/dbri.c +++ b/sys/dev/sbus/dbri.c @@ -1,4 +1,4 @@ -/* $NetBSD: dbri.c,v 1.29 2010/01/14 02:20:07 macallan Exp $ */ +/* $NetBSD: dbri.c,v 1.30 2010/02/18 02:21:38 macallan Exp $ */ /* * Copyright (C) 1997 Rudolf Koenig (rfkoenig@immd4.informatik.uni-erlangen.de) @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: dbri.c,v 1.29 2010/01/14 02:20:07 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dbri.c,v 1.30 2010/02/18 02:21:38 macallan Exp $"); #include "audio.h" #if NAUDIO > 0 @@ -447,8 +447,12 @@ dbri_config_interrupts(device_t dev) struct dbri_softc *sc = device_private(dev); dbri_init(sc); - mmcodec_init(sc); - + if (mmcodec_init(sc) == -1) { + printf("%s: no codec detected, aborting\n", + device_xname(dev)); + return; + } + /* Attach ourselves to the high level audio interface */ audio_attach_mi(&dbri_hw_if, sc, sc->sc_dev); |
