cvs commit: src/sys/dev/iicbus iicbus.c

Nate Lawson nate at root.org
Sun May 16 22:41:29 PDT 2004


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


More information about the cvs-src mailing list