summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2008-09-26 14:19:52 +0000
committered <ed@FreeBSD.org>2008-09-26 14:19:52 +0000
commit4212d51a7da942b0c717c9965552c9549d90de08 (patch)
treef45f750affeffb39e162226343b0db9a110c42ce /sys/dev
parent0a873f95fe4b1e8d5d3f6ead357fca828948b3ac (diff)
downloadFreeBSD-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')
-rw-r--r--sys/dev/led/led.c2
-rw-r--r--sys/dev/sound/pci/emu10kx.c2
-rw-r--r--sys/dev/sound/pcm/dsp.c2
-rw-r--r--sys/dev/sound/pcm/mixer.c2
-rw-r--r--sys/dev/vkbd/vkbd.c2
5 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/led/led.c b/sys/dev/led/led.c
index d086f4e..1d902d5 100644
--- a/sys/dev/led/led.c
+++ b/sys/dev/led/led.c
@@ -257,7 +257,7 @@ led_create_state(led_t *func, void *priv, char const *name, int state)
sc->unit = alloc_unr(led_unit);
sc->private = priv;
sc->func = func;
- sc->dev = make_dev(&led_cdevsw, unit2minor(sc->unit),
+ sc->dev = make_dev(&led_cdevsw, sc->unit,
UID_ROOT, GID_WHEEL, 0600, "led/%s", name);
sx_xunlock(&led_sx);
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);
diff --git a/sys/dev/vkbd/vkbd.c b/sys/dev/vkbd/vkbd.c
index 10e3516..15cf059 100644
--- a/sys/dev/vkbd/vkbd.c
+++ b/sys/dev/vkbd/vkbd.c
@@ -187,7 +187,7 @@ vkbd_dev_clone(void *arg, struct ucred *cred, char *name, int namelen,
/* find any existing device, or allocate new unit number */
if (clone_create(&vkbd_dev_clones, &vkbd_dev_cdevsw, &unit, dev, 0)) {
- *dev = make_dev(&vkbd_dev_cdevsw, unit2minor(unit),
+ *dev = make_dev(&vkbd_dev_cdevsw, unit,
UID_ROOT, GID_WHEEL, 0600, DEVICE_NAME "%d", unit);
if (*dev != NULL) {
dev_ref(*dev);
OpenPOWER on IntegriCloud