On Wed, 23 Jan 2008, Bryan Wu wrote:

> How do you think of following code, Kalle?
> 
>        /*
>          * If "dev->id" is negative we consider it as zero.
>          * The reason to do so is to avoid sysfs names that only make
>          * sense when there are multiple adapters.
>          */
>         p_adap->nr = dev->id >= 0 ? dev->id : 0;
> 
> I found some i2c-gpio, i2c-ibm_iic.c and i2c-pxa.c using this code,
> while others use your idea.

I don't see the point in ever defining dev->id as -1. None of the current 
users of i2c-bfin-twi does that. Another option could be to use dynamic 
bus numbers with dev->id == -1, but I think the only sane way to enumerate 
this kind of SOC busses is to fix the numbers in the machine 
initialization time.

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c

Reply via email to