From 55b00bdc52f4bcec736dc5fb82b76dd7bafacf17 Mon Sep 17 00:00:00 2001 From: cg Date: Tue, 5 Sep 2000 20:58:51 +0000 Subject: [PATCH] be more verbose about failed unload attempts --- sys/dev/sound/pcm/sound.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index a466fd95fe86..0458cd720296 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -331,8 +331,14 @@ pcm_unregister(device_t dev) r = 0; for (i = 0; i < d->chancount; i++) if (d->ref[i]) r = EBUSY; - if (r) return r; - if (mixer_isbusy(d) || status_isopen) return EBUSY; + if (r) { + device_printf(dev, "unregister: channel busy"); + return r; + } + if (mixer_isbusy(d)) { + device_printf(dev, "unregister: mixer busy"); + return EBUSY; + } pdev = makedev(CDEV_MAJOR, PCMMKMINOR(unit, SND_DEV_CTL, 0)); destroy_dev(pdev); @@ -631,6 +637,8 @@ sndpcm_modevent(module_t mod, int type, void *data) case MOD_LOAD: break; case MOD_UNLOAD: + if (status_isopen) + return EBUSY; if (status_dev) destroy_dev(status_dev); status_dev = 0;