Date: Thu, 22 Oct 2009 14:53:44 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/sys/kern subr_bus.c Message-ID: <200910221454.n9MEs4lY028993@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
jhb 2009-10-22 14:53:44 UTC FreeBSD src repository Modified files: sys/kern subr_bus.c Log: SVN rev 198367 on 2009-10-22 14:53:44Z by jhb Set the devclass_t pointer specified in the DRIVER_MODULE() macro sooner so it is always valid when a driver's identify routine is called. Previously, new-bus would attempt to create the devclass for a newly loaded driver in two separate places, once in devclass_add_driver(), and again after devclass_add_driver() returned in driver_module_handler(). Only the second lookup attempted to set a device class' parent and set the devclass_t pointer specified in the DRIVER_MODULE() macro. However, by the time it was executed, the driver was already added to existing instances of the parent driver at which point in time the new driver's identify routine would have been invoked. The fix is to merge the two attempts and only create the devclass once in devclass_add_driver() including setting the devclass_t pointer passed to DRIVER_MODULE() before the driver is added to any existing bus devices. Reported by: avg Reviewed by: imp MFC after: 2 weeks Revision Changes Path 1.233 +14 -24 src/sys/kern/subr_bus.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910221454.n9MEs4lY028993>