[PATCH 2/2] i2c: Add devtree-aware iic support for PPC4xx

Eugene Surovegin ebs at ebshome.net
Tue Oct 16 02:32:16 EST 2007


On Mon, Oct 15, 2007 at 03:29:11PM +0200, Stefan Roese wrote:

<snip>

> +#ifdef CONFIG_PPC_MERGE
> +static int device_idx = -1;
> +#endif
> +

<snip>

> +	dev->idx = ++device_idx;
> +	adap->nr = dev->idx;

Hmm, this doesn't look right. That mighty powerpc device everybody 
was so excited about for the last years doesn't provide a device 
instance number/index?

I think this approach is wrong, because I want i2c bus numbers for the 
on-chip i2c to be fixed. This code makes it dependent on the order 
devices were described in the device tree; how do you handle a 
situation when only the second i2c adapter is connected? For OCP I 
would just remove ocp_def for the IIC0.

-- 
Eugene




More information about the Linuxppc-dev mailing list