Author: ed
Date: Wed Apr 15 20:08:26 2009
New Revision: 191115
URL: http://svn.freebsd.org/changeset/base/191115

Log:
  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.

Modified:
  head/sys/kern/kern_conf.c

Modified: head/sys/kern/kern_conf.c
==============================================================================
--- head/sys/kern/kern_conf.c   Wed Apr 15 19:58:41 2009        (r191114)
+++ head/sys/kern/kern_conf.c   Wed Apr 15 20:08:26 2009        (r191115)
@@ -523,7 +523,7 @@ newdev(struct cdevsw *csw, int y, struct
        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);
                }
        }
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to