From owner-cvs-src-old@FreeBSD.ORG Thu Oct 22 14:54:04 2009 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE2D61065693 for ; Thu, 22 Oct 2009 14:54:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id AC8A88FC17 for ; Thu, 22 Oct 2009 14:54:04 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n9MEs423028994 for ; Thu, 22 Oct 2009 14:54:04 GMT (envelope-from jhb@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n9MEs4lY028993 for cvs-src-old@freebsd.org; Thu, 22 Oct 2009 14:54:04 GMT (envelope-from jhb@repoman.freebsd.org) Message-Id: <200910221454.n9MEs4lY028993@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to jhb@repoman.freebsd.org using -f From: John Baldwin Date: Thu, 22 Oct 2009 14:53:44 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/kern subr_bus.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2009 14:54:04 -0000 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