Commit 066af983 authored by Rodolfo Giometti's avatar Rodolfo Giometti Committed by Jean Delvare

i2c-pxa: Support new-style I2C drivers

Signed-off-by: default avatarRodolfo Giometti <giometti@linux.it>
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
parent 4d6ceed4
...@@ -921,7 +921,14 @@ static int i2c_pxa_probe(struct platform_device *dev) ...@@ -921,7 +921,14 @@ static int i2c_pxa_probe(struct platform_device *dev)
i2c->adap.class = plat->class; i2c->adap.class = plat->class;
} }
ret = i2c_add_adapter(&i2c->adap); /*
* 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.
*/
i2c->adap.nr = dev->id >= 0 ? dev->id : 0;
ret = i2c_add_numbered_adapter(&i2c->adap);
if (ret < 0) { if (ret < 0) {
printk(KERN_INFO "I2C: Failed to add bus\n"); printk(KERN_INFO "I2C: Failed to add bus\n");
goto eadapt; goto eadapt;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment