Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/sbus Abort setup when we find no audio codec to avoi...



details:   https://anonhg.NetBSD.org/src/rev/5f8f8934327d
branches:  trunk
changeset: 752176:5f8f8934327d
user:      macallan <macallan%NetBSD.org@localhost>
date:      Thu Feb 18 02:21:38 2010 +0000

description:
Abort setup when we find no audio codec to avoid crashing later on with
ISDN-only cards.
Should fix PR41055

diffstat:

 sys/dev/sbus/dbri.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r 6d2ed87f6989 -r 5f8f8934327d sys/dev/sbus/dbri.c
--- a/sys/dev/sbus/dbri.c       Thu Feb 18 01:14:00 2010 +0000
+++ b/sys/dev/sbus/dbri.c       Thu Feb 18 02:21:38 2010 +0000
@@ -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@localhost)
@@ -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 @@
        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);
 



Home | Main Index | Thread Index | Old Index