svn commit: r186833 - head/sys/dev/iicbus

Nathan Whitehorn nwhitehorn at freebsd.org
Thu Jan 15 08:05:59 PST 2009


John Baldwin wrote:
> On Tuesday 06 January 2009 12:23:37 pm Nathan Whitehorn wrote:
>   
>> Modified: head/sys/dev/iicbus/iic.c
>> ===========================================================================
>> === --- head/sys/dev/iicbus/iic.c	Tue Jan  6 17:05:44 2009	(r186832)
>> +++ head/sys/dev/iicbus/iic.c	Tue Jan  6 17:23:37 2009	(r186833)
>> @@ -110,14 +110,14 @@ iic_identify(driver_t *driver, device_t
>>  {
>>
>>  	if (device_find_child(parent, "iic", -1) == NULL)
>> -		BUS_ADD_CHILD(parent, 0, "iic", -1);
>> +		BUS_ADD_CHILD(parent, 0, "iic", 0);
>>  }
>>     
>
> This change is wrong, it always tries to add iic0 instead of letting new-bus 
> pick the unit number.  Basically, if you have a system with iicbus0 and 
> iicbus1, this will try to add a second iic0 child to iicbus1 instead of iic1.  
> Please revert.
>   
This is done to allow use of BUS_PROBE_NOWILDCARD, since this device is 
fake and has no actual probe logic. Setting -1 instead of 0 causes the 
device's wildcard bit to be set, and will make it not attach at all. 
Changing the probe method's return value to something else will make 
iicbus/iic attach to every unknown device on the bus on I2C buses that 
attach children like the OFW I2C bus layer.

Since the people using the OFW I2C layer are mostly me for now, I'll 
happily revert the change to this file in its entirety. But this breaks 
other things, and I don't know of a good solution here.
>> Modified: head/sys/dev/iicbus/iicbus.c
>> ===========================================================================
>> === --- head/sys/dev/iicbus/iicbus.c	Tue Jan  6 17:05:44 2009	(r186832) +++
>> head/sys/dev/iicbus/iicbus.c	Tue Jan  6 17:23:37 2009	(r186833) @@ -53,7
>> +53,9 @@ iicbus_probe(device_t dev)
>>  {
>>
>>  	device_set_desc(dev, "Philips I2C bus");
>> -	return (0);
>> +
>> +	/* Allow other subclasses to override this driver. */
>> +	return (-1000);
>>     
>
> I think BUS_PROBE_GENERIC is what you want here.  pci(4) probably needs to be 
> updated to use BUS_PROBE_GENERIC as well (which is what you copied this from 
> I'm guessing).
>   
Yes, exactly. I'll update them both today. Thanks for pointing this out.
-Nathan


More information about the svn-src-head mailing list