summaryrefslogtreecommitdiffstats
path: root/sys/dev/sound/pcm/sound.c
diff options
context:
space:
mode:
authorcg <cg@FreeBSD.org>2002-01-26 22:13:24 +0000
committercg <cg@FreeBSD.org>2002-01-26 22:13:24 +0000
commit7119c584879890efe6e984d27f939052ff2d0d0c (patch)
tree7f5235e1606d17de8b16949b2ddbfff99e3ba640 /sys/dev/sound/pcm/sound.c
parent94fe6c387a335887a3fa8b9073ac110ac597f6d7 (diff)
downloadFreeBSD-src-7119c584879890efe6e984d27f939052ff2d0d0c.zip
FreeBSD-src-7119c584879890efe6e984d27f939052ff2d0d0c.tar.gz
* improve error handling
* be more specific in verbose boot messages * allow the feeder subsystem to veto pcm* attaching if there is an error initialising the root feeder * don't free/malloc a new tmpbuf when resizing a snd_dbuf to the same size as it currently is * store the feeder description in the feeder structure instead of mallocing space for it
Diffstat (limited to 'sys/dev/sound/pcm/sound.c')
-rw-r--r--sys/dev/sound/pcm/sound.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c
index cbd1bc1..535fe35 100644
--- a/sys/dev/sound/pcm/sound.c
+++ b/sys/dev/sound/pcm/sound.c
@@ -55,6 +55,8 @@ struct snddev_info {
devclass_t pcm_devclass;
+int pcm_veto_load = 1;
+
#ifdef USING_DEVFS
int snd_unit = 0;
TUNABLE_INT("hw.snd.unit", &snd_unit);
@@ -599,6 +601,12 @@ pcm_register(device_t dev, void *devinfo, int numplay, int numrec)
{
struct snddev_info *d = device_get_softc(dev);
+ if (pcm_veto_load) {
+ device_printf(dev, "disabled due to an error while initialising: %d\n", pcm_veto_load);
+
+ return EINVAL;
+ }
+
d->lock = snd_mtxcreate(device_get_nameunit(dev));
snd_mtxlock(d->lock);
OpenPOWER on IntegriCloud