From owner-cvs-src@FreeBSD.ORG Sun May 16 22:41:29 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7012416A4D1 for ; Sun, 16 May 2004 22:41:29 -0700 (PDT) Received: from root.org (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 5E8B343D53 for ; Sun, 16 May 2004 22:41:28 -0700 (PDT) (envelope-from nate@root.org) Received: (qmail 16041 invoked by uid 1000); 17 May 2004 05:41:30 -0000 Date: Sun, 16 May 2004 22:41:30 -0700 (PDT) From: Nate Lawson To: Joerg Wunsch In-Reply-To: <20040516211200.6651916A4D9@hub.freebsd.org> Message-ID: <20040516223701.K15923@root.org> References: <20040516211200.6651916A4D9@hub.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/iicbus iicbus.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 May 2004 05:41:29 -0000 On Sun, 16 May 2004, Joerg Wunsch wrote: > joerg 2004/05/16 14:11:46 PDT > > FreeBSD src repository > > Modified files: > sys/dev/iicbus iicbus.c > Log: > After successfully attaching an iicbus instance, instead of using a > NULL name in device_add_child(), explicitly name all of our known > child drivers in order to give them a chance to attach to us. > Otherwise, only the first one present would be probed and attached. > > Reviewed by: nsouch > MFC after: 1 month > > Revision Changes Path > 1.19 +3 -1 src/sys/dev/iicbus/iicbus.c > > --- src/sys/dev/iicbus/iicbus.c:1.18 Wed May 12 06:43:41 2004 > +++ src/sys/dev/iicbus/iicbus.c Sun May 16 14:11:46 2004 > @@ -140,7 +140,9 @@ > #endif > > /* attach any known device */ > - device_add_child(dev, NULL, -1); > + device_add_child(dev, "ic", -1); > + device_add_child(dev, "iic", -1); > + device_add_child(dev, "iicsmb", -1); > > bus_generic_attach(dev); Can more than one of these be active at a time? Or are they different implementations of the same thing? If this is the case, it's better to add one child and have the ic, iic, and iicsmb drivers all probe it and return negative values in order of preference for the device. Or if the child drivers can tell whether or not they're present, use an identify method to let them detect themselves. -Nate