[i2c] I2C Warning on a 405GPr based board with actual 2.6.20-rc5 Kernel

Heiko Schocher hs at denx.de
Mon Jan 22 19:54:00 CET 2007


Hello Jean,

Jean Delvare wrote:
> > Hmm.. I solved it with the following patch, but I don t know if this is
> > the right way.
> > 
> > diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c
> > index 1898e99..140d7fe 100644
> > --- a/drivers/i2c/busses/i2c-ibm_iic.c
> > +++ b/drivers/i2c/busses/i2c-ibm_iic.c
> > @@ -35,6 +35,7 @@
> >  #include <linux/slab.h>
> >  #include <linux/init.h>
> >  #include <linux/interrupt.h>
> > +#include <linux/platform_device.h>
> >  #include <asm/irq.h>
> >  #include <asm/io.h>
> >  #include <linux/i2c.h>
> > @@ -737,6 +738,9 @@ static int __devinit iic_probe(struct ocp_device *ocp){
> >  	adap->timeout = 1;
> >  	adap->retries = 1;
> >  
> > +	if (adap->dev.parent == NULL) {
> > +		adap->dev.parent = &platform_bus;
> > +	}
> >  	if ((ret = i2c_add_adapter(adap)) != 0){
> >  		printk(KERN_CRIT "ibm-iic%d: failed to register i2c adapter\n",
> >  			dev->idx);
> 
> Err, no, it's not correct, sorry. You're doing exactly what we want to
> stop doing in i2c-core, so even if you no longer see the warning, the
> driver will still break when we update i2c-core.
> 
> Please try the following patch instead, it should keep i2c-core quiet,
> and your i2c adapter should even show at the correct location in sysfs:

It tried your patch and it works fine :-)

Thanks
Heiko




More information about the i2c mailing list