From owner-cvs-all@FreeBSD.ORG Mon Sep 11 20:23:10 2006 Return-Path: X-Original-To: cvs-all@freebsd.org Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 44D0916A416; Mon, 11 Sep 2006 20:23:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8B13243D4C; Mon, 11 Sep 2006 20:23:09 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id k8BKN79l020189; Mon, 11 Sep 2006 16:23:07 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: src-committers@freebsd.org Date: Mon, 11 Sep 2006 15:54:01 -0400 User-Agent: KMail/1.9.1 References: <200609111941.k8BJfV8U089067@repoman.freebsd.org> In-Reply-To: <200609111941.k8BJfV8U089067@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200609111554.01848.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 11 Sep 2006 16:23:07 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/1860/Mon Sep 11 12:34:08 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: cvs-src@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/kern bus_if.m subr_bus.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Sep 2006 20:23:10 -0000 On Monday 11 September 2006 15:41, John Baldwin wrote: > jhb 2006-09-11 19:41:31 UTC > > FreeBSD src repository > > Modified files: > sys/kern bus_if.m subr_bus.c > Log: > Add a default method for BUS_ADD_CHILD() that just calls > device_add_child_ordered(). Previously, a device driver that wanted to > add a new child device in its identify routine had to know if the parent > driver had a custom bus_add_child method and use BUS_ADD_CHILD() in that > case, otherwise use device_add_child(). Getting it wrong in either > direction would result in panics or failure to add the child device. Now, > BUS_ADD_CHILD() always works isolating child drivers from having to know > intimate details about the parent driver. > > Discussed with: imp > MFC after: 1 week This means that drivers should really use BUS_ADD_CHILD() rather than device_add_child() btw now (more or less). We normally use wrappers around KOBJ invocations in new-bus to cut down on the shouting (BUS_SETUP_INTR() vs bus_setup_intr(), e.g.), but in this case there's no child device to call device_get_parent() on to get the first arg, so I'm not sure we can make it pretty. I wouldn't like to repurpose device_add_child(), though perhaps we could have a bus_add_child() that didn't accept the order for the common case? -- John Baldwin