[i2c] Numbering of i2c adapters
Rafal Zabdyr
armo at semihalf.com
Tue Sep 11 15:00:28 CEST 2007
Hello
We found a problem which is connected with commit (2.6.23-rc5):
1469fa263870acd890a4b9f6ef557acc5d673b44 "i2c-mpc: Use
i2c_add_numbered_adapter"
1. Our platform has CONFIG_PPC_MERGE=y so the following line don't compile:
i2c->adap.nr = pdev->id;
(file drivers/i2c/busses/i2c-mpc.c, function fsl_i2c_probe())
Moving the above statement out of CONFIG_PPC_MERGE allows to compile,
but there is still a problem with setting adap.nr:
2. In case of using two or more i2c buses, the
i2c_add_numbered_adapter() would fail
in the following section (if statement), because adap->nr is always 0:
status = idr_get_new_above(&i2c_adapter_idr, adap, adap->nr, &id);
if (status == 0 && id != adap->nr) {
status = -EBUSY;
idr_remove(&i2c_adapter_idr, id);
}
3. Setting adap.nr was previously based on pdev->id which is not
available in the context
of_device struct in the new I2C approach.
Do you think it is a problem, or am I missing something?
best regards
--
Rafal Zabdyr
More information about the i2c
mailing list