diff options
author | ed <ed@FreeBSD.org> | 2008-09-26 14:19:52 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2008-09-26 14:19:52 +0000 |
commit | 4212d51a7da942b0c717c9965552c9549d90de08 (patch) | |
tree | f45f750affeffb39e162226343b0db9a110c42ce /sys/dev/sound | |
parent | 0a873f95fe4b1e8d5d3f6ead357fca828948b3ac (diff) | |
download | FreeBSD-src-4212d51a7da942b0c717c9965552c9549d90de08.zip FreeBSD-src-4212d51a7da942b0c717c9965552c9549d90de08.tar.gz |
Remove unit2minor() use from kernel code.
When I changed kern_conf.c three months ago I made device unit numbers
equal to (unneeded) device minor numbers. We used to require
bitshifting, because there were eight bits in the middle that were
reserved for a device major number. Not very long after I turned
dev2unit(), minor(), unit2minor() and minor2unit() into macro's.
The unit2minor() and minor2unit() macro's were no-ops.
We'd better not remove these four macro's from the kernel, because there
is a lot of (external) code that may still depend on them. For now it's
harmless to remove all invocations of unit2minor() and minor2unit().
Reviewed by: kib
Diffstat (limited to 'sys/dev/sound')
-rw-r--r-- | sys/dev/sound/pci/emu10kx.c | 2 | ||||
-rw-r--r-- | sys/dev/sound/pcm/dsp.c | 2 | ||||
-rw-r--r-- | sys/dev/sound/pcm/mixer.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/sound/pci/emu10kx.c b/sys/dev/sound/pci/emu10kx.c index c2a8249..76f7e60 100644 --- a/sys/dev/sound/pci/emu10kx.c +++ b/sys/dev/sound/pci/emu10kx.c @@ -2313,7 +2313,7 @@ emu10kx_dev_init(struct emu_sc_info *sc) mtx_init(&sc->emu10kx_lock, device_get_nameunit(sc->dev), "kxdevlock", 0); unit = device_get_unit(sc->dev); - sc->cdev = make_dev(&emu10kx_cdevsw, unit2minor(unit), UID_ROOT, GID_WHEEL, 0640, "emu10kx%d", unit); + sc->cdev = make_dev(&emu10kx_cdevsw, unit, UID_ROOT, GID_WHEEL, 0640, "emu10kx%d", unit); if (sc->cdev != NULL) { sc->cdev->si_drv1 = sc; return (0); diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index f718975..f13ae31 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -2096,7 +2096,7 @@ dsp_clone_alloc: snd_clone_setmaxunit(d->clones, tumax); if (ce != NULL) { udcmask |= snd_c2unit(cunit); - *dev = make_dev(&dsp_cdevsw, unit2minor(udcmask), + *dev = make_dev(&dsp_cdevsw, udcmask, UID_ROOT, GID_WHEEL, 0666, "%s%d%s%d", devname, unit, devsep, cunit); snd_clone_register(ce, *dev); diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c index 6196817..c3ca4f0 100644 --- a/sys/dev/sound/pcm/mixer.c +++ b/sys/dev/sound/pcm/mixer.c @@ -644,7 +644,7 @@ mixer_init(device_t dev, kobj_class_t cls, void *devinfo) unit = device_get_unit(dev); devunit = snd_mkunit(unit, SND_DEV_CTL, 0); - pdev = make_dev(&mixer_cdevsw, unit2minor(devunit), + pdev = make_dev(&mixer_cdevsw, devunit, UID_ROOT, GID_WHEEL, 0666, "mixer%d", unit); pdev->si_drv1 = m; snddev = device_get_softc(dev); |