Module Name:    src
Committed By:   macallan
Date:           Thu Feb 18 02:21:39 UTC 2010

Modified Files:
        src/sys/dev/sbus: dbri.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/sbus/dbri.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sbus/dbri.c
diff -u src/sys/dev/sbus/dbri.c:1.29 src/sys/dev/sbus/dbri.c:1.30
--- src/sys/dev/sbus/dbri.c:1.29	Thu Jan 14 02:20:07 2010
+++ src/sys/dev/sbus/dbri.c	Thu Feb 18 02:21:38 2010
@@ -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 (rfkoe...@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 @@
 	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);
 

Reply via email to