Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 May 2004 22:41:30 -0700 (PDT)
From:      Nate Lawson <nate@root.org>
To:        Joerg Wunsch <joerg@FreeBSD.org>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/dev/iicbus iicbus.c
Message-ID:  <20040516223701.K15923@root.org>
In-Reply-To: <20040516211200.6651916A4D9@hub.freebsd.org>
References:  <20040516211200.6651916A4D9@hub.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040516223701.K15923>