diff options
author | ed <ed@FreeBSD.org> | 2009-04-15 20:08:26 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2009-04-15 20:08:26 +0000 |
commit | 6df1ef4d2f3daa27007f53a51fdec947db687b69 (patch) | |
tree | e82af5b5e3baa8aed879dedc956aa0c42eb69c3e /sys/kern | |
parent | df64c49f5556074aa93ef6dc3e8bbc3fc8872ba7 (diff) | |
download | FreeBSD-src-6df1ef4d2f3daa27007f53a51fdec947db687b69.zip FreeBSD-src-6df1ef4d2f3daa27007f53a51fdec947db687b69.tar.gz |
Don't use si_drv0 directly.
We should still access si_drv0 using dev2unit(). Also change the
KASSERT() to really print the udev instead of the unit number. I suspect
it's still useful to print the unit number, especially for devices that
use clone lists, so keep the unit number in the panic string.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_conf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c index 3ef55ea..c5223d8 100644 --- a/sys/kern/kern_conf.c +++ b/sys/kern/kern_conf.c @@ -523,7 +523,7 @@ newdev(struct cdevsw *csw, int y, struct cdev *si) if (csw->d_flags & D_NEEDMINOR) { /* We may want to return an existing device */ LIST_FOREACH(si2, &csw->d_devs, si_list) { - if (si2->si_drv0 == udev) { + if (dev2unit(si2) == udev) { dev_free_devlocked(si); return (si2); } @@ -1042,7 +1042,7 @@ clone_cleanup(struct clonedevs **cdp) if (!(cp->cdp_flags & CDP_SCHED_DTR)) { cp->cdp_flags |= CDP_SCHED_DTR; KASSERT(dev->si_flags & SI_NAMED, - ("Driver has goofed in cloning underways udev %x", dev->si_drv0)); + ("Driver has goofed in cloning underways udev %x unit %x", dev2udev(dev), dev2unit(dev))); destroy_devl(dev); } } |